Websocket.disconnect() method throws java.net.SocketException: Socket closed

后端 未结 1 826
慢半拍i
慢半拍i 2021-01-27 08:46

I am using android-websockets library from codebutler in my project. But I ran into problem when I execute disconnect() method. Following is the code:



        
相关标签:
1条回答
  • 2021-01-27 09:10

    It is because the implementation of disconnect() method does not synchronize with the thread which is created in the implementation of connect() method. codebutler/android-websockets is not of commercial quality. The disconnect() method does not perform even the closing handshake which is required by RFC 6455.

    Use another WebSocket library if you don't want to see the error.

    0 讨论(0)
提交回复
热议问题