--- a/svghmi/svghmi_server.py Thu Sep 12 12:54:36 2019 +0200
+++ b/svghmi/svghmi_server.py Thu Sep 12 12:55:32 2019 +0200
@@ -15,21 +15,34 @@
from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol
from autobahn.twisted.resource import WebSocketResource
-# TODO session list lock
class HMISession(object):
def __init__(self, protocol_instance):
- svghmi_sessions.append(self)
+ # TODO: kill existing session for robustness + assert(svghmi_session is None) + self.protocol_instance = protocol_instance + # svghmi_sessions.append(self) # get a unique bit index amont other svghmi_sessions,
# so that we can match flags passed by C->python callback
- svghmi_sessions.remove(self)
+ # svghmi_sessions.remove(self) def onMessage(self, msg):
# TODO : pass it to the C side recieve_message()