Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Error while reconnecting #10

Closed
fatshotty opened this issue Jun 22, 2012 · 1 comment
Closed

Error while reconnecting #10

fatshotty opened this issue Jun 22, 2012 · 1 comment

Comments

@fatshotty
Copy link
Contributor

Hi there,

I have my socket.io client connected to my socket.io nodejs server. Everything works ;)

After same changes on my nodejs server code, I perform a deploy on the remote server.
I'm using capistrano for deploying, so the nodejs server will be shutdown and restarted again in a few seconds.

Unfortunately Socket.io-java client will get error and will not perform a new connection :(
I investigated and I found the reason (hope can help)

Here is the method that wants to perform a new connection.
https://github.com/Gottox/socket.io-java-client/blob/master/src/io/socket/WebsocketTransport.java#L129

Unfortunately the code (in weberknecht internally) throws an ArrayIndexOutOfBoundException and the code in Socket.io-java client doesn't catch the exception. So, in this case the TimerThread will exit without give us the possibility to catch it. :(

I think the correct code is implemented here:
https://github.com/Gottox/socket.io-java-client/blob/master/src/io/socket/WebsocketTransport.java#L78

catching all generic Exception, socket.io-java client should be able to skip the fatal exception and try again reconnecting.

Hope this can help ;)

@Gottox
Copy link
Owner

Gottox commented Jun 24, 2012

Thanks for reporting, I hope this is fixed now. Thanks :)

@Gottox Gottox closed this as completed Jun 24, 2012
Gottox added a commit that referenced this issue Jun 24, 2012
Gottox added a commit that referenced this issue Oct 1, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants