TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.

Home Page:http://tootallnate.github.io/Java-WebSocket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(QNX + Azul JVM) When clients is re-connecting to WebSocket server there will be delay on handshake

artado opened this issue · comments

commented

Description
When clients is re-connecting to my WebSocket server there will be delay of "connectionLostTimeout" until handshake will be responded to client. Please let me know if you have any suggestions.

To Reproduce
Steps to reproduce the behavior:

  1. Test WebSocket client is connecting to server, handshake is initiated within milliseconds
  2. When I disconnect the client and immediately reconnect it the connection will be established within the timeframe of connectionLostTimeout

Please note: when I change the WebSocketServer connectionLostTimeout parameter to something a lot smaller than default 60 seconds (e.g. 2 seconds) -- re-connection & handshake will happen within a timeframe of a new connectionLostTimeout (e.g. 2 seconds). However in this case I risk to break the connection by Server side.

You can see the same in Wireshark log:
image

Example application to reproduce the issue

    MyWebSocketServer server;
    public void doStartServer(){
        server = new MyWebSocketServer(getPort());
        server.start();
    }

    public void doStopServer(){
        try {
            server.stop();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}

public class MyWebSocketServer extends WebSocketServer {
    public MyWebSocketServer(int port) {
        super(new InetSocketAddress(port));
    }
}

Expected behavior
Expected that it will reconnect immediately.

Environment:
Please note that this is running on embedded hardware, I do not have the same problem running the code on Linux or Windows.

  • Version used: 1.5.3
  • Java version: azul-zre-compact3-qnx7-arm
  • Operating System and version: QNX7

I have to say - I have no idea how to even start debugging this. If you can provide step by step instructions how to set up an environment with QNX and Azul JVM (or at least one of them so we can check which one is causing the issue), I can look into it.

Closing as I do not have a way to reproduce. If there is any update, let me know.