Skip to content

trying to avoid exception error when Internet connection drops #3

@sallespro

Description

@sallespro

hi, i am successfully using this lib, but there's one "corner" i could not figure out how to deal with.

when we switch off WiFi for instance, the app crashes because of this unhandled exception.

 java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)
            at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
            at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
            at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
            at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
            at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
            at libcore.io.Streams.readSingleByte(Streams.java:41)
            at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:236)
            at java.io.DataInputStream.readByte(DataInputStream.java:75)
            at com.saulpower.fayeclient.HybiParser.start(HybiParser.java:120)
            at com.saulpower.fayeclient.WebSocketClient$1.run(WebSocketClient.java:155)
            at java.lang.Thread.run(Thread.java:841)
     Caused by: libcore.io.ErrnoException: recvfrom failed: ETIMEDOUT (Connection timed out)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions