Я использовал эту библиотеку для сокета.
implementation ('com.github.nkzawa:socket.io-client:0.3.0',{
exclude group:'org.json', module:'json'
})
Я нашел несколько решений для проблемы подключений WebSocket, но все еще сталкиваюсь с этой проблемой.
Fatal Exception: org.java_websocket.exceptions.WebsocketNotConnectedException
org.java_websocket.WebSocketImpl.send (WebSocketImpl.java:566)
org.java_websocket.WebSocketImpl.send (WebSocketImpl.java:543)
org.java_websocket.client.WebSocketClient.send (WebSocketClient.java:171)
com.github.nkzawa.engineio.client.transports.WebSocket$2.call (WebSocket.java:114)
com.github.nkzawa.engineio.parser.Parser.encodePacket (Parser.java:63)
com.github.nkzawa.engineio.parser.Parser.encodePacket (Parser.java:42)
com.github.nkzawa.engineio.client.transports.WebSocket.write (WebSocket.java:110)
com.github.nkzawa.engineio.client.Transport$3.run (Transport.java:98)
com.github.nkzawa.thread.EventThread.exec (EventThread.java:50)
com.github.nkzawa.engineio.client.Transport.send (Transport.java:94)
com.github.nkzawa.engineio.client.Socket.flush (Socket.java:596)
com.github.nkzawa.engineio.client.Socket.sendPacket (Socket.java:681)
com.github.nkzawa.engineio.client.Socket.sendPacket (Socket.java:655)
com.github.nkzawa.engineio.client.Socket.access$1500 (Socket.java:29)
com.github.nkzawa.engineio.client.Socket$17.run (Socket.java:565)
com.github.nkzawa.thread.EventThread.exec (EventThread.java:50)
com.github.nkzawa.engineio.client.Socket.ping (Socket.java:562)
com.github.nkzawa.engineio.client.Socket$16$1.run (Socket.java:550)
com.github.nkzawa.thread.EventThread$2.run (EventThread.java:75)