autobahn

Connecting to websocket using SocketChannel Android

大憨熊 提交于 2020-01-04 13:59:12
问题 I have written android app which connects to a websocket server, server app and android app implemented with Autobahn websocket library. I can connect and exchange the messages with server successfully. but after some time(after 20 - 30 mins) android app stop communicating with server(it cannot send messages to server). On logcat shows app still connect to websocket even though it cannot send messages to server. I have went through the source code of Autobahn library and found that it using

Logging WAMP worker Trace Back Error

别等时光非礼了梦想. 提交于 2020-01-03 05:37:08
问题 I have been trying to debug Remote Procedure Calls for WAMP (Web Application Messaging Protocol) based python components. For example: Front end (browser) session.call('math.add2', [2, 'two']); Back end (python) @wamp.register("math.add2") def add2(self, x, y): return x + y It gives a little bit of idea about the error. For a simple example like this, it doesn't really matter at all but for large applications with a lot of files and modules, Im not quite sure about the best way to pin point

Combining implementation of autobahn websockets, gstreamers and html5 mediaSource API

狂风中的少年 提交于 2020-01-02 16:24:26
问题 I am running a websocket server using autobahn|python. on the server side, I also have a gstreamer pipeline running which I am using to capture webm frames using "appsink". The gstreamer pipeline that is implemented is: gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! videoconvert ! vp8enc ! webmmux ! appsink name="sink" Everytime, I receive a buffer in the appsink, I send it over a websocket as a binary "message" using sendMessage. def on_new_buffer(appsink): global once gstsample

Combining implementation of autobahn websockets, gstreamers and html5 mediaSource API

无人久伴 提交于 2020-01-02 16:24:09
问题 I am running a websocket server using autobahn|python. on the server side, I also have a gstreamer pipeline running which I am using to capture webm frames using "appsink". The gstreamer pipeline that is implemented is: gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! videoconvert ! vp8enc ! webmmux ! appsink name="sink" Everytime, I receive a buffer in the appsink, I send it over a websocket as a binary "message" using sendMessage. def on_new_buffer(appsink): global once gstsample

Android - Autobahn Websocket sending message error(NullPointerException)

混江龙づ霸主 提交于 2019-12-24 19:55:35
问题 I am working on websocket communication with Autobahn. On the main.class of my app, I set to call 'connect()' when users click a button. // Toggle Button event tButton = (ToggleButton) findViewById(R.id.toggleButton1); tButton.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(isChecked){ }else{ } } }); And after that, there is MyOffers.class, and if this class is accessed, MyOffers_Fragment

Can autobahn.twisted.wamp.Application do pub/sub?

你。 提交于 2019-12-24 11:58:31
问题 I would like to use some pub/sub features along with rpc from autobahn.twisted.wamp.Application I'd prefer not to make a ApplicationSession class if I can get by without doing so. Can registered rpc methods cause client subscriptions and publish? If they can, please show me how. 回答1: Yes, sure: def onEvent(msg): print("got event: {}".format(msg)) @app.register('com.example.triggersubscribe') def triggerSubscribe(): yield app.session.subscribe(onEvent, 'com.example.topic1') When

Autobahn with sendMessage using threading and twisted

99封情书 提交于 2019-12-24 04:49:08
问题 From this thread (sendMessage from outside in autobahn running in separate thread) I am trying to get the code below working. But I am getting the following error: File "/usr/local/lib/python2.7/dist-packages/autobahn/websocket/protocol.py", line 2421, in sendMessage assert(type(payload) == bytes) exceptions.AssertionError: Can anybody tell me where I am going wrong? from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory import threading from twisted.python

Autobahn websocket issue while running with twistd using tac file

穿精又带淫゛_ 提交于 2019-12-23 13:11:42
问题 I have a WebSocket server implemented using autobahn WebSocket framework using twisted. WebSocket server runs fine when the program ran with python. But if I run this using twistd server runner by creating tac file as twisted service, I get the following error in server while any client try to establish connection and the handshake is failing. 2015-12-08 07:17:56,022 - CRITICAL - twisted.publishToNewObserver() 154 Unhandled Error Traceback (most recent call last): File "/opt/nrgi-ws/nrgi-ws

Reading Messages on Poloniex Trollbox with Python autbahn or other socket module?

限于喜欢 提交于 2019-12-20 02:49:09
问题 Poloniex doesn't return every message to my socket. I read the messages with the following code and sometimes I get continuous message numbers, but sometimes there are like 10 messages missing: from autobahn.asyncio.wamp import ApplicationSession from autobahn.asyncio.wamp import ApplicationRunner from asyncio import coroutine class PoloniexComponent(ApplicationSession): def onConnect(self): self.join(self.config.realm) @coroutine def onJoin(self, details): def onTrollbox(*args): print("type:

Trial unittests using Autobahn WebSocket

喜你入骨 提交于 2019-12-19 09:49:12
问题 I'm trying to write unittests for my application that uses Autobahn. I want to test my controllers which gets received data from protocol, parses it and reacts to it. But when my test comes to a point when protocol should be disconnected ( self.sendClose ) then it raises error exceptions.AttributeError: 'MyProtocol' object has no attribute 'state'. I was trying to makeConnection using proto_helpers.StringTransport but then I have errors too exceptions.AttributeError: StringTransport instance