Skip to content
  • Philip Withnall's avatar
    gsocket: Enable TCP_NODELAY by default for stream GSockets · 039876e6
    Philip Withnall authored
    
    
    `TCP_NODELAY` disables Nagle’s algorithm, which is generally a better
    default for modern networks than having it enabled. Nagle’s algorithm
    delays sending small data blobs until they fill an entire TCP segment,
    so as to amortise the cost of sending the segment.
    
    This improves bandwidth at the cost of latency. Given the large
    bandwidth capabilities of most modern networks, most streams are
    constrained by latency rather than bandwidth, so disabling Nagle’s
    algorithm makes sense.
    
    Various other major bits of software (such as libcurl) already disable
    Nagle’s algorithm by default.
    
    Specific applications which need it can turn it back on by calling
    `g_socket_set_option()`.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    
    Fixes: #791
    039876e6