When I try to connect to the server in Socket.io, I get this error: I just tried to connect and the application crashed.
Task threw exception
java.lang.IllegalArgumentException
at java.nio.Buffer.limit(Buffer.java:290)
at java.nio.ByteBuffer.limit(ByteBuffer.java:820)
at io.socket.engineio.parser.Parser.decodePayload(Parser.java:280)
at io.socket.engineio.client.transports.Polling._onData(Polling.java:137)
at io.socket.engineio.client.transports.Polling.onData(Polling.java:107)
at io.socket.engineio.client.transports.PollingXHR$5$1.run(PollingXHR.java:127)
at io.socket.thread.EventThread$2.run(EventThread.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
FATAL EXCEPTION: EventThread
Process: com.package.name, PID: 24625
java.lang.IllegalArgumentException
at java.nio.Buffer.limit(Buffer.java:290)
at java.nio.ByteBuffer.limit(ByteBuffer.java:820)
at io.socket.engineio.parser.Parser.decodePayload(Parser.java:280)
at io.socket.engineio.client.transports.Polling._onData(Polling.java:137)
at io.socket.engineio.client.transports.Polling.onData(Polling.java:107)
at io.socket.engineio.client.transports.PollingXHR$5$1.run(PollingXHR.java:127)
at io.socket.thread.EventThread$2.run(EventThread.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
I just wanted to connect to the server
The reason why this error occurred to me was due to the Windows firewall. When I tested it on a physical device, not the emulator, the problem was resolved.