WAMP : prefix callee names with given ID so that multiple PLC and IDE can join the same realm
--- a/connectors/WAMP/__init__.py Mon Feb 09 00:45:03 2015 +0100
+++ b/connectors/WAMP/__init__.py Mon Feb 09 10:55:06 2015 +0100
@@ -96,12 +96,13 @@
reactor.run(installSignalHandlers=False)
def WampSessionProcMapper(funcname):
+ wampfuncname = '.'.join((ID,funcname))
def catcher_func(*args,**kwargs):
global _WampSession
if _WampSession is not None :
try:
return threads.blockingCallFromThread(
- reactor, _WampSession.call, funcname,
+ reactor, _WampSession.call, wampfuncname,
*args,**kwargs)
except TransportLost, e:
confnodesroot.logger.write_error("Connection lost!\n")
--- a/runtime/WampClient.py Mon Feb 09 00:45:03 2015 +0100
+++ b/runtime/WampClient.py Mon Feb 09 10:55:06 2015 +0100
@@ -40,9 +40,10 @@
def onJoin(self, details):
global _WampSession
_WampSession = self
- print 'WAMP session joined by :', self.config.extra["ID"]
+ ID = self.config.extra["ID"]
+ print 'WAMP session joined by :', ID
for name in ExposedCalls:
- reg = yield self.register(MakeCallee(name), name)
+ reg = yield self.register(MakeCallee(name), '.'.join((ID,name)))
def onLeave(self, details):
global _WampSession