Reconnect problem
I have a service that when start:
private void connect() { LogUtil.i("Conectando com o SocketIO"); socketIO.connect(); }
and when finish:
private void disconnectIOSocket() { if ( socketIO != null ) { socketIO.close(); socketIO.disconnect(); } }
Everything are working great but when i stop the service and try to connect again nothing happen after the command:
socketIO.connect();
Reconnecting sockets is not supported for now. Please see https://github.com/nkzawa/socket.io-client.java/issues/21
Depending on your use case, setting forceNew might solve your problem:
IO.Options opts = new IO.Options();
opts.forceNew = true;
I think the issue is that closed sockets cannot be reused.
Yes, you can create new sockets, but can't reuse closed sockets. thx, @discretepackets !
Work for me. Thanks. Close this issue.