最新消息:20210917 已从crifan.com换到crifan.org

[已解决]android端的websocket库autoban的关于ping和pong的支持

Android crifan 3284浏览 0评论

android autobahn send ping

Send ping message from autobahn android websocket client – Stack Overflow

java – Connecting to websocket using SocketChannel Android – Stack Overflow

Send ping message from autobahn android websocket client – Stack Overflow

-》别人已有的,添加了ping和pong支持的,代码改动:

Added #sendPingMessage and #onPongMessage to allow client to initiate PingPong by william-ferguson-au · Pull Request #67 · crossbario/autobahn-android

完整代码:

autobahn-android/WebSocketConnection.java at master · crossbario/autobahn-android

【总结】

最后是参考:

Added #sendPingMessage and #onPongMessage to allow client to initiate PingPong by william-ferguson-au · Pull Request #67 · crossbario/autobahn-android

去改动先有的autobahn的库,然后就添加上了ping和pong的支持

然后代码中就可以调用ping和pong去保持连接了。

转载请注明:在路上 » [已解决]android端的websocket库autoban的关于ping和pong的支持

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.201 seconds, using 23.35MB memory