====== Socket Options ======

The ''[[dir:ctrl]]/sockopts.ini'' [[:config:ini files|.ini file]] allows global control over the [[https://linux.die.net/man/3/setsockopt|socket options]] that are applied when Synchronet creates [[wp>network sockets]].

  * The //root// section contains options that are applied to //all// opened sockets.

  * The ''[tcp]'' section contains options that are applied //only// to opened TCP  (so-called ''STREAM'') sockets. 

  * The ''[udp]'' section contains options that are applied //only// to opened UDP (so-called ''DATAGRAM'') sockets. 

  * The ''[unix]'' section contains options that are applied //only// to opened //Unix Domain// sockets. 

  * Other sections may be defined with one or more //protocol// names (separated by ''|'') as the section name and for these sections, the socket options contained within are //only// applied to opened sockets for the specified protocol(s).

===== Options =====
Most of the options should not be changed by the sysop without a detailed understanding of the effects. That said, here's the list of supported options (many are OS/Network stack dependent):

^ Option ^ 
| ''TYPE'' |
| ''ERROR'' |
| ''DEBUG'' |
| ''LINGER'' |
| ''SNDBUF'' |
| ''RCVBUF'' |
| ''SNDLOWAT'' |
| ''RCVLOWAT'' |
| ''SNDTIMEO'' |
| ''RCVTIMEO'' |
| ''USELOOPBACK'' |
| ''REUSEADDR'' |
| ''REUSEPORT'' |
| ''EXCLUSIVEADDRUSE'' |
| ''KEEPALIVE'' |
| ''DONTROUTE'' |
| ''BROADCAST'' |
| ''OOBINLINE'' |
| ''ACCEPTCONN'' |
| ''PRIORITY'' |
| ''NO_CHECK'' |
| ''PROTOTYPE'' |
| ''MAX_MSG_SIZE'' |
| ''CONNECT_TIME'' |
| ''TCP_NODELAY'' |
| ''TCP_MAXSEG'' |
| ''TCP_CORK'' |
| ''TCP_KEEPIDLE'' |
| ''TCP_KEEPINTVL'' |
| ''TCP_KEEPCNT'' |
| ''TCP_KEEPALIVE'' |
| ''TCP_SYNCNT'' |
| ''TCP_LINGER2'' |
| ''TCP_DEFER_ACCEPT'' |
| ''TCP_WINDOW_CLAMP'' |
| ''TCP_QUICKACK'' |
| ''TCP_NOPUSH'' |
| ''TCP_NOOPT'' |
| ''IPV6_V6ONLY'' |


===== See Also =====
  * [[:config:|Configuration]]
  * [[https://linux.die.net/man/3/setsockopt|Linux socket interface]]
  * [[https://docs.microsoft.com/en-us/windows/win32/winsock/socket-options|Windows Socket Options]]
  * [[https://docs.microsoft.com/en-us/windows/win32/winsock/sol-socket-socket-options|Windows SOL_SOCKET Socket Options]]


{{tag>configuration operating_system ini}}
