有时,Android高速公路上的Websockets连接丢失了

时间:2016-01-19 05:17:10

标签: android autobahn autobahnws

我在Android和iOS上都有聊天应用。在Android上我正在使用高速公路。在iOS上我使用的是SocketRocket。在服务器端,我正在使用Autobahn for Python。

有时我的消息无法在Android上发送,因为连接丢失了。我还没有在iOS上看到这个问题。我不认为这是一个服务器问题,因为它在iOS上一直运行正常(据我所知)。我没有重新启动服务器或任何东西。有时消息可以在Android上运行。

这是我尝试发送消息的日志消息:

01-18 23:49:51.307 1875-1875/com.greenrobot.yesorno D/de.tavendo.autobahn.WebSocketConnection: opening handshake received

01-18 23:49:51.379 1875-1875/com.greenrobot.yesorno D/MoPub: Refresh disabled for ad unit (8fb0facec32111e295fa123138070049).

01-18 23:49:51.383 1875-1918/com.greenrobot.yesorno D/OpenGLRenderer: endAllStagingAnimators on 0xdd232b80 (ListView) with handle 0xe12c0f00

01-18 23:49:58.960 1875-2726/com.greenrobot.yesorno D/de.tavendo.autobahn.WebSocketReader: run() : ConnectionLost

01-18 23:49:58.961 1875-2726/com.greenrobot.yesorno D/de.tavendo.autobahn.WebSocketReader: ended

01-18 23:49:58.961 1875-1875/com.greenrobot.yesorno D/de.tavendo.autobahn.WebSocketConnection: fail connection [code = 3, reason = WebSockets connection lost

01-18 23:49:58.961 1875-1875/com.greenrobot.yesorno D/de.tavendo.autobahn.WebSocketReader: quit

01-18 23:49:58.961 1875-2727/com.greenrobot.yesorno D/de.tavendo.autobahn.WebSocketWriter: ended

01-18 23:49:58.962 1875-1875/com.greenrobot.yesorno D/de.tavendo.autobahn.WebSocketConnection: worker threads stopped

有谁知道如何解决这个连接丢失的问题,或者你知道Android的另一个websocket库吗?

1 个答案:

答案 0 :(得分:0)

Autobahn不是Android支持的websocket实现。对我来说,与高速公路的交易破坏者是SSL/TLS (wss) support,似乎仍然不受支持。

question涵盖Android的现有websocket实现。答案详述了这些实现的一些已知问题。根据您的特定项目要求,您可以消除几个选项。