Skip to content

Setting async timeout on WebSocketClient does not seem to timeout writes #847

@eoghanoh1

Description

@eoghanoh1

Version: Jetty 9.3.6.

I am using jetty web socket native web socket implementation (not JSR-356).

I enabled the async write timeout on WebSocketClient to be greater than the max idle timeout. Looking through the Jetty code, it looks like the async write timeout is required to be larger than max idle (makes sense to me).

I ran the following test;

  1. plug network cable out of client machine
  2. attempt to send data over the web socket via either;
    a) RemoteEndpoint.sendString(String data) [* blocking]
    b) RemoteEndpoint.sendString(String data, WriteCallback callback)
    c) RemoteEndpoint.sendStringByFuture(String data)

With a);
The web socket closes after ~19 seconds.

With b);
I get a writeSuccess callback invoked, even though the data could not have been sent. I would not have expected this, since the data could not be sent. Is this callback for the status of the write to the queue rather than actually transmission of the data?
The web socket closes after ~19 seconds.

With c);
The web socket closes after ~19 seconds.

For the two async send API's above (b & c), I would have expected that the write for sending the data (@ point 2) would timeout once the async write timeout is exceeded.

Is this an incorrect assumption, if so can you give an overview as to what the async write timeout is for? Also could you advise me how or if I can configure Jetty to timeout sending data after a defined timeout.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions