Nagle algorithm in socket.io

Does anyone know how to configure the nagle algorithm (on or off) when using socket.io?
Is this option even provided with socket.io?
I assume that the default behavior is set to use the nagle algorithm (please correct me if I am wrong).

Ideally, I would like to configure nagle algo (on / off) when using socket.io as needed in different applications - no matter which web application server I can use.

Thank!

+5
source share
2 answers

Guillermo Rauch Nagle socket.io. , (, ).

.

+3

nagle

int socket_descriptor;  
BOOL bOptVal = TRUE;
int bOptLen = sizeof(BOOL);
// get a socket:
socket_descriptor = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
/* ... bind the socket, listen to it
    .
    .
*/
// set the socket to non-blocking mode:
ioctlsocket(socket_descriptor, FIONBIO, 1);

// disable nagle:
setsockopt(socket_descriptor, IPPROTO_TCP, TCP_NODELAY, (char*)&bOptVal, bOptLen);

: .NET Socket.NoDelay.

socket.io nagle -, - beeing ( 2012 ).

+1

All Articles