autobahn

python websocket failure when run in openshift

孤人 提交于 2020-06-17 03:05:32
问题 I have a autobahn twisted websocket running in python which is working in a dev vm correctly but I have been unable to get working when the server is running in openshift. Here is the shortened code which works for me in a vm. from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory, listenWS from autobahn.twisted.resource import WebSocketResource class MyServerProtocol(WebSocketServerProtocol): def onConnect(self, request): stuff... def onOpen(self): stuff...

python websocket failure when run in openshift

偶尔善良 提交于 2020-06-17 03:05:17
问题 I have a autobahn twisted websocket running in python which is working in a dev vm correctly but I have been unable to get working when the server is running in openshift. Here is the shortened code which works for me in a vm. from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory, listenWS from autobahn.twisted.resource import WebSocketResource class MyServerProtocol(WebSocketServerProtocol): def onConnect(self, request): stuff... def onOpen(self): stuff...

sendMessage from outside in autobahn running in separate thread by using “asyncio”

泪湿孤枕 提交于 2020-01-24 20:00:11
问题 I want to call sendMessage method from outside of MyServerProtocol class and send a message to the server. The answare is very similar to this but i need to use asyncio instead of twisted . Cane someone suggest me a solution? An example derived from this would also be appreciated Thanks. 回答1: The call_soon_threadsafe function of event loop is meant for this. from autobahn.asyncio.websocket import WebSocketServerProtocol, \ WebSocketServerFactory class MyServerProtocol(WebSocketServerProtocol)

Design pattern for getting initial value in pubsub in autobahn

一曲冷凌霜 提交于 2020-01-24 18:25:15
问题 Normally, a publish-subscribe pattern is about fetching content updates. But how do subscribers get initial content that was there before they subscribed for updates? I'm using publish-subscribe examples within autobahn framework for my application. The publisher backend publishes a position of the robotic joint when the joint moves. The client frontend subscribes to the topic sometimes later. Due to the nature of the data, the initial value of the "topic" on the client is just as important

Design pattern for getting initial value in pubsub in autobahn

蹲街弑〆低调 提交于 2020-01-24 18:25:07
问题 Normally, a publish-subscribe pattern is about fetching content updates. But how do subscribers get initial content that was there before they subscribed for updates? I'm using publish-subscribe examples within autobahn framework for my application. The publisher backend publishes a position of the robotic joint when the joint moves. The client frontend subscribes to the topic sometimes later. Due to the nature of the data, the initial value of the "topic" on the client is just as important

How to solve websocket ping timeout?

佐手、 提交于 2020-01-14 05:23:16
问题 While running the following piece of code (in theory it should send a value every minute) from __future__ import print_function from twisted.internet.ssl import CertificateOptions options = CertificateOptions() from os import environ from twisted.internet.defer import inlineCallbacks from twisted.internet import reactor from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner from autobahn import wamp from datetime import datetime, timedelta import xlwings as wb import time