moved future core server and handler code to act as the default core-daemon, updated future examples and tests to leverage new api

This commit is contained in:
Blake J. Harnden 2018-04-25 16:33:58 -07:00
parent f431895357
commit 8644e9d61e
24 changed files with 618 additions and 2728 deletions

View file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,30 @@
"""
Defines core server for handling TCP connections.
"""
import SocketServer
from core.future.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)