varspool / Wrench

A simple PHP WebSocket implementation for PHP 7.1
Do What The F*ck You Want To Public License
596 stars 210 forks source link

Disable Nagle's algorithm in client sockets #104

Closed dobrakmato closed 7 years ago

dobrakmato commented 7 years ago

Nagle's algorithm causes messages to be delivered in batches, which causes performance problems in latency critical applications (for example games).

Nagle's algorithm is turned off be default for WebSocket connections in all major browsers. Many other WebSocket libraries use TCP_NODELAY also.

References: https://bugs.webkit.org/show_bug.cgi?id=102079 https://groups.google.com/forum/#!topic/native-client-discuss/T8zdrMjiTAE https://github.com/websockets/ws/issues/791