JO
Topics
11 Jul 2023, 20:05
593
1
11 May 2023, 22:32
768
3
11 Apr 2023, 01:56
697
2
Replies
jon.slater
06 May 2023, 01:22
( Updated at: 06 May 2023, 01:23 )
Instead I used a websocket and a http server :
for path, resource in resources.items():
root.putChild(path, resource)
reactor.listenTCP(http_port, Site(root))
factory_set_live = WebSocketServerFactory()
factory_set_live.protocol = WebSocketProtocol
set_live_ws_resource = WebSocketResource(factory_set_live)
root.putChild(b"ws", set_live_ws_resource)
reactor.listenTCP(websocket_port, factory_set_live)
print(
f"listening on ports {http_port} (HTTP) and {websocket_port} (WebSocket).")
_data.start()
reactor.run()
Reactor is very robust; I never used it before.
I hope this can help somebody else.
@jon.slater
jon.slater
12 May 2023, 04:19
This is a red herring.
Sorry about; the data period is correct.
Thanks.
@jon.slater