diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -223,6 +223,130 @@ The module :mod:`socket` exports the fol in the Unix header files are defined; for a few symbols, default values are provided. +.. data:: LOCAL_PEERCRED + + Get peer credentials (``ucred`` structure). + + .. versionadded:: 3.3 + +.. data:: SO_ACCEPTCONN + + Get listening status of the socket (get only). + +.. data:: SO_BINDTODEVICE + + Bind this socket to a symbolic device name like ``eth0`` instead of using + :meth:`socket.bind` to bind it to an IP address. + + .. versionadded:: 3.3 + +.. data:: SO_BROADCAST + + Enable/disable permission to transmit broadcast messages. + +.. data:: SO_DEBUG + + Enable/disable recording of debugging information. + +.. data:: SO_DONTROUTE + + Enable/disable routing bypass for outgoing messages. + +.. data:: SO_ERROR + + Get and clear error on the socket (get only) + +.. data:: SO_EXCLUSIVEADDRUSE + + The :data:`SO_EXCLUSIVEADDRUSE` option prevents other sockets from being + forcibly bound to the same address and port, a practice enabled by the + :data:`SO_REUSEADDR` socket option. Such reuse can be executed by malicious + applications to disrupt the application. The :data:`SO_EXCLUSIVEADDRUSE` + option is very useful to system services requiring high availability. + +.. data:: SO_KEEPALIVE + + Enable/disable keep connections alive. + +.. data:: SO_LINGER + + Linger on close if data is present. + +.. data:: SO_PASSCRED + + Enable/disable the receiving of the :data:`SCM_CREDENTIALS` control message. + + .. versionadded:: 3.3 + +.. data:: SO_OOBINLINE + + Enable/disable reception of out-of-band data in band. + +.. data:: SO_PEERCRED + + Get the credentials of the foreign process connected to this socket. This is + only possible for connected :data:`AF_UNIX` stream sockets and + :data:`AF_UNIX` stream and datagram socket pairs created using + :func:`socketpair`. The returned credentials are those that were in effect + at the time of the call to :meth:`socket.connect` or :func:`socketpair`. + Argument is a ``ucred`` structure. Only valid as a + :meth:`socket.getsockopt`. + + .. versionadded:: 3.3 + +.. data:: SO_REUSEADDR + + Enable/disable local address reuse. + +.. data:: SO_REUSEPORT + + Enable duplicate address and port bindings. + +.. data:: SO_RCVBUF + + Set buffer size in bytes for input. + +.. data:: SO_RCVLOWAT + + Set the minimum number of bytes in the buffer until the socket layer will + pass the data to the user on receiving. + +.. data:: SO_RCVTIMEO + + Set timeout value (``timeval`` structure) for input. + + See also :meth:`socket.settimeout`. + +.. data:: SO_SETFIB + + Set the associated FIB (routing table) for the socket (set only). + + .. versionadded:: 3.2 + +.. data:: SO_SNDBUF + + Set buffer size in bytes for output. + +.. data:: SO_SNDLOWAT + + Set the minimum number of bytes in the buffer until the socket layer will + pass the data to the protocol. + +.. data:: SO_SNDTIMEO + + Set timeout value (``timeval`` structure) for output. + + See also :meth:`socket.settimeout`. + +.. data:: SO_TYPE + + Get the type of the socket (get only). + +.. data:: SO_USELOOPBACK + + Use the local loopback address when sending data from this socket. This + option should only be used when all data sent will also be received locally. + .. data:: AF_CAN PF_CAN SOL_CAN_*