--- a/runtime/WampClient.py Tue Mar 27 10:11:04 2018 +0200
+++ b/runtime/WampClient.py Mon Apr 09 14:38:38 2018 +0200
@@ -26,6 +26,7 @@
from __future__ import print_function
from autobahn.twisted import wamp
from autobahn.twisted.websocket import WampWebSocketClientFactory, connectWS
from autobahn.wamp import types, auth
@@ -110,6 +111,25 @@
class ReconnectingWampWebSocketClientFactory(WampWebSocketClientFactory, ReconnectingClientFactory):
+ def __init__(self, config, *args, **kwargs): + WampWebSocketClientFactory.__init__(self, *args, **kwargs) + arguments = inspect.getargspec(self.setProtocolOptions).args + protocolOptions = config.extra.get('protocolOptions', None) + validProtocolOptions = {} + for key in protocolOptions: + validProtocolOptions[key] = protocolOptions[key] + if len(validProtocolOptions) > 0: + self.setProtocolOptions(**validProtocolOptions) + print(_("Added custom protocol options")) + del validProtocolOptions def buildProtocol(self, addr):
return ReconnectingClientFactory.buildProtocol(self, addr)
@@ -168,6 +188,7 @@
# create a WAMP-over-WebSocket transport client factory
transport_factory = ReconnectingWampWebSocketClientFactory(
serializers=[MsgPackSerializer()])
--- a/tests/wamp/project_files/wampconf.json Tue Mar 27 10:11:04 2018 +0200
+++ b/tests/wamp/project_files/wampconf.json Mon Apr 09 14:38:38 2018 +0200
@@ -3,5 +3,6 @@
+ "protocolOptions":{"autoPingTimeout":20, "autoPingInterval":60}