| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

socket_nodelay

#include "sflsock.h"
int
socket_nodelay (
    sock_t handle)

Synopsis

Disables Nagle's algorithm for the specified socket; use this when you want to ensure that data is sent outwards as fast as possible, and when you are certain that Nagle's algorithm is causing a slowdown in performance. Recommended for HTTP, but not recommended for telnet. Returns 0 if okay, SOCKET_ERROR if there was a problem.

Source Code - (sflsock.c)

{
#if (defined (__WINDOWS__))
    int
        true_value = 1;                 /*  Boolean value for setsockopt()   */

    return (setsockopt ((SOCKET) handle, IPPROTO_TCP, TCP_NODELAY,
                        (char *) &true_value, sizeof (true_value)));

#elif (defined (TCP_NODELAY) && defined (SOL_TCP))
    int
        true_value = 1;                 /*  Boolean value for setsockopt()   */

    return (setsockopt ((SOCKET) handle, SOL_TCP, TCP_NODELAY,
                        (char *) &true_value, sizeof (true_value)));
#else
    return (0);                         /*  Not applicable to this system    */
#endif
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation