package eio
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ba11ad486f492130dbb486f2b3bdc4905643f10016806ddf86e9a34e4346aaa5
sha512=57ef2c137ccdc26d8029e636b6a4ee92da7c6b2f35954946bd56ca595d6947a8ec42f6f83f8552f73d6719e6ce2314cae2e2fad1686a387522935e6f90e9a8d9
doc/eio/Eio/Net/Sockopt/index.html
Module Net.SockoptSource
An extensible type for socket options. Portable options can be defined here, while platform-specific options can be added by backends.
Common options
type t += | SO_DEBUG : bool t(*Enable socket debugging
*)| SO_BROADCAST : bool t(*Permit sending of broadcast messages
*)| SO_REUSEADDR : bool t(*Allow reuse of local addresses
*)| SO_KEEPALIVE : bool t(*Keep TCP connection alive
*)| SO_DONTROUTE : bool t(*Bypass routing tables
*)| SO_OOBINLINE : bool t(*Leave out-of-band data in line
*)| TCP_NODELAY : bool t(*Disable Nagle's algorithm
*)| IPV6_ONLY : bool t(*Restrict to IPv6 only
*)| SO_REUSEPORT : bool t(*Allow reuse of local port
*)| SO_SNDBUF : int t(*Send buffer size
*)| SO_RCVBUF : int t(*Receive buffer size
*)| SO_RCVLOWAT : int t(*Receive low water mark
*)| SO_SNDLOWAT : int t(*Send low water mark
*)| SO_LINGER : int option t(*Linger on close if data present
*)| SO_RCVTIMEO : float t(*Receive timeout
*)| SO_SNDTIMEO : float t(*Send timeout
*)| TCP_KEEPIDLE : int t(*Time (in seconds) the connection needs to remain idle before TCP starts sending keepalive probes. Available on FreeBSD, Linux, macOS, Windows.
*)| TCP_KEEPINTVL : int t(*Interval (in seconds) between individual keepalive probes. Available on FreeBSD, Linux, macOS, Windows.
*)| TCP_KEEPCNT : int t(*Maximum number of keepalive probes TCP should send before dropping the connection. Available on FreeBSD, Linux, macOS, Windows.
*)| TCP_CONGESTION : string t(*Set the TCP congestion control algorithm to be used (e.g., "cubic", "reno"). Unprivileged processes are restricted to algorithms in tcp_allowed_congestion_control. Available on FreeBSD, Linux.
*)
Linux-specific options
type t += | TCP_CORK : bool t(*When enabled, partial frames are not sent out. Data is only sent when the option is disabled or the buffer becomes full.
*)| TCP_USER_TIMEOUT : int t(*Maximum time (in milliseconds) that transmitted data may remain unacknowledged before TCP will forcibly close the connection.
*)| TCP_MAXSEG : int t(*The maximum segment size for outgoing TCP packets. If set before connection establishment, it also changes the MSS value announced to the other end.
*)| TCP_LINGER2 : int option t(*Lifetime of orphaned FIN_WAIT2 sockets, in seconds.
On set,
NoneorSome 0requests the system default;Some nwithn >= 0keeps orphaned sockets in FIN_WAIT2 fornseconds; negative values raiseInvalid_argument.On get,
*)Some nis the effective timeout andNonemeans FIN_WAIT2 lingering has been disabled.| TCP_DEFER_ACCEPT : int t(*Allow a listener to be awakened only when data arrives on the socket. Value is the maximum time in seconds to wait for data.
*)| TCP_SYNCNT : int t(*Set the number of SYN retransmits that TCP should send before aborting the attempt to connect. Cannot exceed 255.
*)| TCP_WINDOW_CLAMP : int t(*Bound the size of the advertised window to this value. The kernel imposes a minimum size.
*)| TCP_QUICKACK : bool t(*Enable quickack mode if set or disable if cleared. In quickack mode, acks are sent immediately rather than delayed. This flag is not permanent.
*)| TCP_FASTOPEN : int t(*Enable Fast Open (RFC 7413) on the listener socket. The value specifies the maximum length of pending SYNs (similar to backlog in listen).
*)| IP_FREEBIND : bool t(*Allow binding to an IP address that is nonlocal or does not (yet) exist. This permits listening on a socket without requiring the underlying network interface to be up.
*)| IP_BIND_ADDRESS_NO_PORT : bool t(*Inform the kernel to not reserve an ephemeral port when using bind() with a port number of 0. The port will be chosen at connect() time.
*)| IP_LOCAL_PORT_RANGE : (int * int) t(*Set the per-socket local port range as (lower_bound, upper_bound). Both bounds are inclusive and must be in range 0-65535. Use (0, 0) to reset to system defaults.
*)| IP_TTL : int t(*Set or retrieve the time-to-live field used in every packet sent from this socket. Valid range is 1-255.
*)| IP_MTU : int t(*Retrieve the current known path MTU of the current socket. Only valid for connected sockets. This is a read-only option.
*)| IP_MTU_DISCOVER : [ `Want | `Dont | `Do | `Probe ] t(*Set or receive the Path MTU Discovery setting for a socket.
`Want: Use per-route settings (fragment if needed)`Dont: Never do Path MTU Discovery`Do: Always do Path MTU Discovery (reject large datagrams with EMSGSIZE)`Probe: Set DF but ignore Path MTU (for diagnostic tools)
Registering printers (for backend use only)
register_printer { get } adds get to the list of printers.
If called with an option it recognises, it should return the option's name and a printer for values of the appropriate type. If the option isn't known, return None.