TIP #344: BRING TCP_NODELAY AND SO_KEEPALIVE TO SOCKET OPTIONS ================================================================ Version: $Revision: 1.2 $ Author: Alexandre Ferrieux State: Draft Type: Project Tcl-Version: 8.7 Vote: Pending Created: Wednesday, 31 December 2008 URL: https://tip.tcl-lang.org344.html Post-History: ------------------------------------------------------------------------- ABSTRACT ========== Just expose to script level, via *fconfigure*, the two most important setsockopt() use cases: TCP_NODELAY (disabling the Nagle agorithm) and SO_KEEPALIVE (sending automatic keepalives). BACKGROUND & RATIONALE ======================== Currently, there is no way to set nodefault values to a Tcl socket's underlying socket options TCP_NODELAY and SO_KEEPALIVE. That is frustrating because all TCP stacks support setsockopt(). Of these two options, the most important I guess is TCP_NODELAY. Indeed, the Nagle algorithm being on by default may introduce unwanted latencies in some specific cases. This TIP does not try to argument about the prevalence of these cases; the ubiquity of setsockopt(TCP_NODELAY) suffices to justify exposing it to script level. PROPOSED CHANGE ================= This TIP proposes to add two boolean [fconfigure] options to sockets: *-nodelay* (or *-nonagle*, or *-nagle*, take your pick) and *-keepalive*. REFERENCE IMPLEMENTATION ========================== Pretty trivial; will be provided shortly after validation. The code has even been in place for a long time, though only in the Windows-specific part, and commented/ifdef'ed out... COPYRIGHT =========== This document has been placed in the public domain. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows