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:
parent
f431895357
commit
8644e9d61e
24 changed files with 618 additions and 2728 deletions
0
daemon/core/legacy/__init__.py
Normal file
0
daemon/core/legacy/__init__.py
Normal file
1231
daemon/core/legacy/corehandler.py
Normal file
1231
daemon/core/legacy/corehandler.py
Normal file
File diff suppressed because it is too large
Load diff
30
daemon/core/legacy/coreserver.py
Normal file
30
daemon/core/legacy/coreserver.py
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue