TakahikoKawasaki / nv-websocket-client

High-quality WebSocket client implementation in Java.
Apache License 2.0
2.03k stars 292 forks source link

TCP_NODELAY #141

Closed ange-black69 closed 5 years ago

ange-black69 commented 6 years ago

Hello, I don't find how to disable the nagle algorithm in the underlying client socket ? I've a server that running websocket and have nagle disabled. My client is using a wrapper of nv-websocket-client (https://github.com/czyzby/gdx-lml/tree/master/websocket), I put a issue there, but the author advice me to post here as the wrapper use nv-websocket-client.

Thank you

TakahikoKawasaki commented 6 years ago

I hope the following code works.

WebSocket ws = ...;
ws.getSocket().setTcpNoDelay(false);
ange-black69 commented 6 years ago

hello Takahiko thank you for your answer, Fortunately I found a solution to my problem. In fact, I deploy my game to browser, so I cross-compile with gwt and the web browser automaticaly handle the websocket as TcpNoDelay so no need to explicity define it !