author | Edouard Tisserant |
Wed, 25 Feb 2015 13:59:01 +0100 | |
changeset 1451 | 94e620cbd9de |
parent 1446 | 4963e3816641 |
child 1511 | 91538d0c242c |
permissions | -rw-r--r-- |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
1 |
#!/usr/bin/env python |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
2 |
# -*- coding: utf-8 -*- |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
3 |
|
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
4 |
import sys |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
5 |
#from twisted.python import log |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
6 |
from autobahn.twisted import wamp |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
7 |
from autobahn.twisted.websocket import WampWebSocketClientFactory, connectWS |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
8 |
from twisted.internet.defer import inlineCallbacks |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
9 |
from autobahn.wamp import types |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
10 |
from autobahn.wamp.serializer import MsgPackSerializer |
1441
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
11 |
from twisted.internet.protocol import ReconnectingClientFactory |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
12 |
import json |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
13 |
|
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
14 |
_WampSession = None |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
15 |
_PySrv = None |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
16 |
|
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
17 |
ExposedCalls = ["StartPLC", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
18 |
"StopPLC", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
19 |
"ForceReload", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
20 |
"GetPLCstatus", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
21 |
"NewPLC", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
22 |
"MatchMD5", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
23 |
"SetTraceVariablesList", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
24 |
"GetTraceVariables", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
25 |
"RemoteExec", |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
26 |
"GetLogMessage", |
1441
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
27 |
"ResetLogCount", |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
28 |
] |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
29 |
|
1446
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
30 |
SubscribedEvents = [] |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
31 |
|
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
32 |
DoOnJoin = [] |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
33 |
|
1445
e25479e3fe11
More versatile registering of wamp callees
Edouard Tisserant
parents:
1443
diff
changeset
|
34 |
def GetCallee(name): |
1446
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
35 |
""" Get Callee or Subscriber corresponding to '.' spearated object path """ |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
36 |
global _PySrv |
1445
e25479e3fe11
More versatile registering of wamp callees
Edouard Tisserant
parents:
1443
diff
changeset
|
37 |
names = name.split('.') |
e25479e3fe11
More versatile registering of wamp callees
Edouard Tisserant
parents:
1443
diff
changeset
|
38 |
obj = _PySrv.plcobj |
e25479e3fe11
More versatile registering of wamp callees
Edouard Tisserant
parents:
1443
diff
changeset
|
39 |
while names: obj = getattr(obj, names.pop(0)) |
e25479e3fe11
More versatile registering of wamp callees
Edouard Tisserant
parents:
1443
diff
changeset
|
40 |
return obj |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
41 |
|
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
42 |
class WampSession(wamp.ApplicationSession): |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
43 |
|
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
44 |
@inlineCallbacks |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
45 |
def onJoin(self, details): |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
46 |
global _WampSession |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
47 |
_WampSession = self |
1443
ff8a22d45c44
WAMP : prefix callee names with given ID so that multiple PLC and IDE can join the same realm
Edouard Tisserant
parents:
1441
diff
changeset
|
48 |
ID = self.config.extra["ID"] |
ff8a22d45c44
WAMP : prefix callee names with given ID so that multiple PLC and IDE can join the same realm
Edouard Tisserant
parents:
1441
diff
changeset
|
49 |
print 'WAMP session joined by :', ID |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
50 |
for name in ExposedCalls: |
1445
e25479e3fe11
More versatile registering of wamp callees
Edouard Tisserant
parents:
1443
diff
changeset
|
51 |
reg = yield self.register(GetCallee(name), '.'.join((ID,name))) |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
52 |
|
1446
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
53 |
for name in SubscribedEvents: |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
54 |
reg = yield self.subscribe(GetCallee(name), name) |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
55 |
|
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
56 |
for func in DoOnJoin: |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
57 |
yield func(self) |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
58 |
|
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
59 |
def onLeave(self, details): |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
60 |
global _WampSession |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
61 |
_WampSession = None |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
62 |
print 'WAMP session left' |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
63 |
|
1441
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
64 |
class ReconnectingWampWebSocketClientFactory(WampWebSocketClientFactory, ReconnectingClientFactory): |
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
65 |
def clientConnectionFailed(self, connector, reason): |
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
66 |
print("WAMP Client connection failed .. retrying ..") |
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
67 |
self.retry(connector) |
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
68 |
def clientConnectionLost(self, connector, reason): |
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
69 |
print("WAMP Client connection lost .. retrying ..") |
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
70 |
self.retry(connector) |
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
71 |
|
1446
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
72 |
def LoadWampClientConf(wampconf): |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
73 |
|
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
74 |
WSClientConf = json.load(open(wampconf)) |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
75 |
return WSClientConf |
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
76 |
|
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
77 |
def RegisterWampClient(wampconf): |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
78 |
|
1446
4963e3816641
Split runtime's twisted modules import and setup to ease runtime extensions hotpatching
Edouard Tisserant
parents:
1445
diff
changeset
|
79 |
WSClientConf = LoadWampClientConf(wampconf) |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
80 |
|
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
81 |
## start logging to console |
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
82 |
# log.startLogging(sys.stdout) |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
83 |
|
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
84 |
# create a WAMP application session factory |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
85 |
component_config = types.ComponentConfig( |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
86 |
realm = WSClientConf["realm"], |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
87 |
extra = {"ID":WSClientConf["ID"]}) |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
88 |
session_factory = wamp.ApplicationSessionFactory( |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
89 |
config = component_config) |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
90 |
session_factory.session = WampSession |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
91 |
|
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
92 |
# create a WAMP-over-WebSocket transport client factory |
1441
826730e60407
Added auto-reconnect for runtime. Fixed Beremiz closing problem caused by remaining twisted reactor thread in IDE.
Edouard Tisserant
parents:
1440
diff
changeset
|
93 |
transport_factory = ReconnectingWampWebSocketClientFactory( |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
94 |
session_factory, |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
95 |
url = WSClientConf["url"], |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
96 |
serializers = [MsgPackSerializer()], |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
97 |
debug = False, |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
98 |
debug_wamp = False) |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
99 |
|
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
100 |
# start the client from a Twisted endpoint |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
101 |
conn = connectWS(transport_factory) |
1440
e8daabf2c438
Runtime : Added PLCobject methods registring. IDE : Added WAMP connector. Still need some fixes
Edouard Tisserant
parents:
1439
diff
changeset
|
102 |
print "WAMP client connecting to :",WSClientConf["url"] |
1439
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
103 |
return conn |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
104 |
|
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
105 |
def GetSession(): |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
106 |
global _WampSession |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
107 |
return _WampSession |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
108 |
|
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
109 |
def SetServer(pysrv): |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
110 |
global _PySrv |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
111 |
_PySrv = pysrv |
a68cd4253259
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff
changeset
|
112 |