pusher / pusher-websocket-java

Pusher Channels client library for Java targeting general Java and Android
Other
309 stars 143 forks source link

UnresolvedAddressException with WebSocket library #7

Closed ocram closed 11 years ago

ocram commented 11 years ago

I cannot tell the exact steps to reproduce this, but my Android application crashes for a great number of users with the following Exception:

java.nio.channels.UnresolvedAddressException
at java.nio.SocketChannelImpl.validateAddress(SocketChannelImpl.java:422)
at java.nio.SocketChannelImpl.connect(SocketChannelImpl.java:154)
at org.java_websocket.client.WebSocketClient.void run()(SourceFile:188)
at java.lang.Thread.run(Thread.java:856)java.nio.channels.UnresolvedAddressException
at java.nio.SocketChannelImpl.validateAddress(SocketChannelImpl.java:422)
at java.nio.SocketChannelImpl.connect(SocketChannelImpl.java:154)
at org.java_websocket.client.WebSocketClient.void run()(SourceFile:188)
at java.lang.Thread.run(Thread.java:856)

And there's no way to handle this yet.

I'm not sure how this is affected by this issue and its solution: https://github.com/leggetter/pusher-java-client/issues/8

For this problem, that solution does not seem to work, at least.

ocram commented 11 years ago

I was able to verify now that this Exception triggers the ConnectionEventListener's onError() method.

onError() is called with the following message: "An exception was thrown by the websocket"

Is this absolutely normal behaviour and we should just indicate to clients that there was a connection problem? Or is it a bug in the WebSocket library? I'm asking because I see quite a lot of those Exceptions appearing.

leggetter commented 11 years ago

Without further details of the exception it's impossible to know if it's expected or not.

If errors are occurring related to the connection and the onError method is called then that is expected behaviour.

RahimRahimov commented 8 years ago

check this: http://stackoverflow.com/a/40498520/4576879