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

Ping timeout from server #107

Closed
kantorr opened this issue Mar 3, 2021 · 3 comments
Closed

Ping timeout from server #107

kantorr opened this issue Mar 3, 2021 · 3 comments

Comments

@kantorr
Copy link

kantorr commented Mar 3, 2021

My Client is always disconnected from socketIO server after 60 seconds. It seems like my client is not pinging the server but I dont know why that is or where can I setup the pingInterval. Here are my Options for the socket:

 client = new OkHttpClient();
        options = new Options();
        // IO factory options
        options.forceNew = false;
        options.multiplex = true;
        // low-level engine options
        options.transports = new String[]{WebSocket.NAME};
        options.upgrade = false;
        options.rememberUpgrade = false;
        options.query = null;//.setQuery(null)
        options.extraHeaders = null;//.setExtraHeaders(null)
        // Manager options
        options.reconnection = true;//.setReconnection(true)
        options.reconnectionAttempts = 5;//.setReconnectionAttempts(Integer.MAX_VALUE)
        options.reconnectionDelay = 1000;//.setReconnectionDelay(1_000)
        options.reconnectionDelayMax = 5000;//.setReconnectionDelayMax(5_000)
        options.randomizationFactor = 0.5;//.setRandomizationFactor(0.5)
        options.timeout = -1;//30000;
        
        options.callFactory = client;
        options.webSocketFactory = client;

        options.port = port;
        options.path = path;

I presume I have to match the pingInterval with the SocketIO server but where do i set it up?

Java Client: egine.io-client-2.0.0.jar, socket.io-client-1.0.0.jar

@TizioIncognito
Copy link

Hi, I also encountered this problem.
I found a bug in class "EventThread".
Some times the concurrency of the thread may lock this class and in the class "WebSocket" the boolean "writable" remains false, so the client don't send packets anymore and lost connection.
I create a pull request today with the solution.
#108

@missthom
Copy link

missthom commented Jul 8, 2021

I get same this issue. I use engine.io-client-2.0.0.jar and socket.io-client-1.0.1.jar,
My Client is always disconnected from socketIO server after some minutes. I don't know what to do, It shows log:

io.socket.engineio.client.EngineIOException: websocket error in EVENT_ERROR.

Any solutions for this issue???? Help me?

@darrachequesne
Copy link
Member

That looks like a version mismatch between the server and the client.

Please check the compatibility table here: https://socketio.github.io/socket.io-client-java/installation.html#Compatibility

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

4 participants