--- a/runtime/WampClient.py Thu Apr 19 13:40:56 2018 +0200
+++ b/runtime/WampClient.py Wed May 09 09:59:53 2018 +0200
@@ -26,6 +26,7 @@
from __future__ import print_function
from autobahn.twisted import wamp
@@ -207,9 +208,10 @@
- print(_("WAMP load error: "), ve)
+ print(_("WAMP save error: "), ve)
+ print(_("WAMP save error: "), e) def LoadWampSecret(secretfname):
@@ -272,24 +274,33 @@
print(_("WAMP client connecting to :"), WSClientConf["url"])
+def StopReconnectWampClient(): + _transportFactory.stopTrying() + return _WampSession.leave() -def ReconnectWampClient(active, url):
+def StartReconnectWampClient(): + _WampSession.disconnect() +def ReconnectionWampClient(active, url): + """ReconnectionWampClient function used for reconnecting to Crossbar router. + active (bool): Value in wampconf.json file. True: using Wamp connection. False: not using Wamp connection. + url (str): Value in wampconf.json file. Url of Crossbar router. SaveWampClientConf(_WampConf, url, active)
- if not active and _WampSession:
- # crossbar connection active is off, retry connection off
- _transportFactory.stopTrying()
- return _WampSession.leave()
- elif _WampSession and active:
- _WampSession.disconnect()
- elif not _WampSession and active:
- # crossbar connection active is on, do connect
+ StartReconnectWampClient() + elif not active and _WampSession: + StopReconnectWampClient() --- a/tests/wamp/project_files/wampconf.json Thu Apr 19 13:40:56 2018 +0200
+++ b/tests/wamp/project_files/wampconf.json Wed May 09 09:59:53 2018 +0200
@@ -1,4 +1,5 @@
"url":"ws://127.0.0.1:8888",