Android WebSocket

看看看J神怎么说
https://medium.com/square-corner-blog/web-sockets-now-shipping-in-okhttp-3-5-463a9eec82d1
OkHttp3.5 已经开始支持WebSocket

Android WebSocket_第1张图片
image.png

官网demo
https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java

Android WebSocket_第2张图片
image.png

详细自行查看

你可能感兴趣的:(Android WebSocket)