-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDOIP_server_main.py
41 lines (37 loc) · 1.49 KB
/
DOIP_server_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'''
Created on 11.05.2023
@author: Ulrich Schwardmann, Göttingen
@email: [email protected]
@license: CC BY-SA
'''
import logging
import asyncio
#from DOIPutils import DOIPconfiguration
from server import DOIPserver_implementation_xmpl
from server import DOIPserver as DOIPss
import DOIPutils.DOIPconfiguration as DOIPconfiguration
########## module_xmpl_main function ###########
def main():
"""
This is the server. It handles the sockets. It passes requests to the
listener (the second argument). The server will run in its own thread
so that we can kill it when we need to.
"""
LogMsg = logging.getLogger('module_xmpl_main server')
operations = DOIPserver_implementation_xmpl.DOIPServerOperationsImplementation()
server_config = DOIPconfiguration.DOIPConfig(config_path = default_dir, config_file = "srv.cfg")
AuthMethods = DOIPserver_implementation_xmpl.DOIPServerAuthMethodsImplementation(server_config)
server = DOIPss.asyncioRequestHandler(server_config, operations, AuthMethods)
operations.set_server(server)
LogMsg.debug("start server")
asyncio.run(server.start_server())
########## module_xmpl_main section ###########
if __name__ == '__main__':
default_dir = "/home/uschwar1/ownCloud/AC/python/xmpls/DOIP_socketserver_disabled/"
main()
# call Op.Hello with:
# { "operationId" : "0.DOIP/Op.Hello", "targetId" : "20.500.123/service" }
#
#
# test with openssl s_client -connect localhost:8493
# port depends on config file