WebSocket frames may get lost when a client side WebSocket establishes a connection and the server sends the first WebSocket frames immediately after sending the Opening Handshake.
The client side websocket reads and parses the HTTP response before detaching the socket from the HTTPClientSession to be passed to the WebSocket. If, at the time of reading the HTTP Response from the server, a WebSocket Frame has already been sent (and is available in the client side TCP buffer), the HTTPInputStream will receive data from the socket beyond the end of the HTTP response (due to a buffer size of 4096 bytes). This data will consequently not be available to the WebSocket once the WebSocket is established.
This bug requires every server to wait a short time before sending data after completing the WebSocket handshake.
WebSocket frames may get lost when a client side WebSocket establishes a connection and the server sends the first WebSocket frames immediately after sending the Opening Handshake.
The client side websocket reads and parses the HTTP response before detaching the socket from the HTTPClientSession to be passed to the WebSocket. If, at the time of reading the HTTP Response from the server, a WebSocket Frame has already been sent (and is available in the client side TCP buffer), the HTTPInputStream will receive data from the socket beyond the end of the HTTP response (due to a buffer size of 4096 bytes). This data will consequently not be available to the WebSocket once the WebSocket is established.
This bug requires every server to wait a short time before sending data after completing the WebSocket handshake.