Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling disconnect throws exception #19

Open
Umaid1 opened this issue Mar 25, 2014 · 6 comments
Open

Calling disconnect throws exception #19

Umaid1 opened this issue Mar 25, 2014 · 6 comments

Comments

@Umaid1
Copy link

Umaid1 commented Mar 25, 2014

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)

@PEZ
Copy link

PEZ commented Mar 28, 2014

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;

@Umaid1
Copy link
Author

Umaid1 commented Mar 29, 2014

Can you please tell me how did you resolved it?

@mackong
Copy link

mackong commented May 21, 2014

I have this issue too, Did you solved it?

@WashRinseRepeat
Copy link

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 :/

@vallivenkatesan
Copy link

Can somebody tell how you solved this problem? Thanks in advance.

@BooboNikita
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants