86 |
91 |
87 @inlineCallbacks |
92 @inlineCallbacks |
88 def onJoin(self, details): |
93 def onJoin(self, details): |
89 global _WampSession |
94 global _WampSession |
90 _WampSession = self |
95 _WampSession = self |
91 ID = self.config.extra["ID"] |
96 ID = self.config.extra["ID"] # this is unicode |
92 print('WAMP session joined by :', ID) |
97 print('WAMP session joined by :', ID) |
93 for name in ExposedCalls: |
98 for name in ExposedCalls: |
94 regoption = types.RegisterOptions(u'exact',u'last',None, None) |
99 regoption = types.RegisterOptions(u'exact',u'last',None, None) |
95 yield self.register(GetCallee(name), '.'.join((ID, name)), regoption) |
100 yield self.register(GetCallee(name), u'.'.join((ID, name)), regoption) |
96 |
101 |
97 for name in SubscribedEvents: |
102 for name in SubscribedEvents: |
98 yield self.subscribe(GetCallee(name), name) |
103 yield self.subscribe(GetCallee(name), unicode(name)) |
99 |
104 |
100 for func in DoOnJoin: |
105 for func in DoOnJoin: |
101 yield func(self) |
106 yield func(self) |
102 |
107 |
103 def onLeave(self, details): |
108 def onLeave(self, details): |
148 WampSecret = LoadWampSecret(secretfname) |
153 WampSecret = LoadWampSecret(secretfname) |
149 |
154 |
150 # create a WAMP application session factory |
155 # create a WAMP application session factory |
151 component_config = types.ComponentConfig( |
156 component_config = types.ComponentConfig( |
152 realm=WSClientConf["realm"], |
157 realm=WSClientConf["realm"], |
153 extra=WSClientConf) |
158 extra=WSClientConf) # pass a dict containing unicode values |
154 session_factory = wamp.ApplicationSessionFactory( |
159 session_factory = wamp.ApplicationSessionFactory( |
155 config=component_config) |
160 config=component_config) |
156 session_factory.session = WampSession |
161 session_factory.session = WampSession |
157 |
162 |
158 # create a WAMP-over-WebSocket transport client factory |
163 # create a WAMP-over-WebSocket transport client factory |