--- a/runtime/WampClient.py Fri May 18 11:05:49 2018 +0200
+++ b/runtime/WampClient.py Tue Jun 05 15:29:58 2018 +0200
@@ -27,7 +27,6 @@
from autobahn.twisted import wamp
from autobahn.twisted.websocket import WampWebSocketClientFactory, connectWS
@@ -137,14 +136,14 @@
WampWebSocketClientFactory.__init__(self, *args, **kwargs)
- protocolOptions = config.extra.get('protocolOptions', None)
- arguments = inspect.getargspec(self.setProtocolOptions).args
- validProtocolOptions = getValidOptins(protocolOptions, arguments)
- if validProtocolOptions:
- self.setProtocolOptions(**validProtocolOptions)
- #print(_("Added custom protocol options"))
- _transportFactory = self
+ protocolOptions = config.extra.get('protocolOptions', None) + self.setProtocolOptions(**protocolOptions) + _transportFactory = self + print(_("Custom protocol options failed :"), e) + _transportFactory = None def buildProtocol(self, addr):
@@ -199,6 +198,8 @@
with open(os.path.realpath(_WampConf), 'w') as f:
json.dump(WSClientConf, f, sort_keys=True, indent=4)
if 'active' in WSClientConf and WSClientConf['active']:
+ if _transportFactory and _WampSession: + StopReconnectWampClient() StartReconnectWampClient()
StopReconnectWampClient()
@@ -262,16 +263,20 @@
session_factory.session = WampSession
# create a WAMP-over-WebSocket transport client factory
- transport_factory = ReconnectingWampWebSocketClientFactory(
+ ReconnectingWampWebSocketClientFactory( serializers=[MsgPackSerializer()])
# start the client from a Twisted endpoint
- conn = connectWS(transport_factory)
- print(_("WAMP client connecting to :"), WSClientConf["url"])
+ conn = connectWS(_transportFactory) + print(_("WAMP client connecting to :"), WSClientConf["url"]) + print(_("WAMP client can not connect to :"), WSClientConf["url"]) def StopReconnectWampClient():