Open Umaid1 opened 10 years ago
I have a similar issue. Getting this when I close the socket:
D/WebSocketClient( 418): WebSocket EOF! D/WebSocketClient( 418): java.io.EOFException D/WebSocketClient( 418): at java.io.DataInputStream.readByte(DataInputStream.java:98) D/WebSocketClient( 418): at com.codebutler.android_websockets.HybiParser.start(HybiParser.java:112) D/WebSocketClient( 418): at com.codebutler.android_websockets.WebSocketClient$1.run(WebSocketClient.java:134) D/WebSocketClient( 418): at java.lang.Thread.run(Thread.java:856)
Seems like the stream.available() == -1
in HybiParser.java should guard against that?
109: if (stream.available() == -1) break;
110: switch (mStage) {
111: case 0:
112: parseOpcode(stream.readByte());
113: break;
Can you please tell me how did you resolved it?
I have this issue too, Did you solved it?
Hi, I'm also having this issue. It's a problem, because right now I cannot do proper error handling in the app, since I cannot distinguish between a clean close of the socket and a genuine error. I tried looking into the code, but I'm not proficient enough to actually solve this myself :/
Can somebody tell how you solved this problem? Thanks in advance.
109: if (stream.available() == -1) break;
110: switch (mStage) {
111: case 0:
112: if (stream.available() == -1) break;
113: parseOpcode(stream.readByte());
114: break;
I do like this and it may work.
03-25 16:29:39.992: E/TAG(21060): java.net.SocketException: Socket closed 03-25 16:29:39.992: E/TAG(21060): at libcore.io.Posix.recvfromBytes(Native Method) 03-25 16:29:39.992: E/TAG(21060): at libcore.io.Posix.recvfrom(Posix.java:131) 03-25 16:29:39.992: E/TAG(21060): at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164) 03-25 16:29:39.992: E/TAG(21060): at libcore.io.IoBridge.recvfrom(IoBridge.java:513) 03-25 16:29:39.992: E/TAG(21060): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488) 03-25 16:29:39.992: E/TAG(21060): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46) 03-25 16:29:39.992: E/TAG(21060): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240) 03-25 16:29:39.992: E/TAG(21060): at libcore.io.Streams.readSingleByte(Streams.java:41) 03-25 16:29:39.992: E/TAG(21060): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:236) 03-25 16:29:39.992: E/TAG(21060): at java.io.DataInputStream.readByte(DataInputStream.java:96) 03-25 16:29:39.992: E/TAG(21060): at com.codebutler.android_websockets.HybiParser.start(HybiParser.java:112) 03-25 16:29:39.992: E/TAG(21060): at com.codebutler.android_websockets.WebSocketClient$1.run(WebSocketClient.java:134) 03-25 16:29:39.992: E/TAG(21060): at java.lang.Thread.run(Thread.java:856) 03-25 16:29:40.397: A/libc(21060): Fatal signal 11 (SIGSEGV) at 0x00000027 (code=1), thread 21065 (JDWP)