refactored new apis to sit under the emulator module, also reverted moving files under a legacy module to help avoid breaking code using core internals for 5.0+

This commit is contained in:
Blake J. Harnden 2018-05-01 10:40:25 -07:00
parent 9cb1513933
commit f5bff494c7
17 changed files with 53 additions and 50 deletions

30
daemon/core/coreserver.py Normal file
View file

@ -0,0 +1,30 @@
"""
Defines core server for handling TCP connections.
"""
import SocketServer
from core.emulator.coreemu import CoreEmu
class CoreServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
"""
TCP server class, manages sessions and spawns request handlers for
incoming connections.
"""
daemon_threads = True
allow_reuse_address = True
def __init__(self, server_address, handler_class, config=None):
"""
Server class initialization takes configuration data and calls
the SocketServer constructor
:param tuple[str, int] server_address: server host and port to use
:param class handler_class: request handler
:param dict config: configuration setting
:return:
"""
self.coreemu = CoreEmu(config)
self.config = config
SocketServer.TCPServer.__init__(self, server_address, handler_class)