@@ -23,7 +23,7 @@ all modern Unix systems, Windows, MacOS, and probably additional platforms.
2323
2424The Python interface is a straightforward transliteration of the Unix system
2525call and library interface for sockets to Python's object-oriented style: the
26- :func: `.socket ` function returns a :dfn: `socket object ` whose methods implement
26+ :func: `~socket .socket ` function returns a :dfn: `socket object ` whose methods implement
2727the various socket system calls. Parameter types are somewhat higher-level than
2828in the C interface: as with :meth: `read ` and :meth: `write ` operations on Python
2929files, buffer allocation on receive operations is automatic, and buffer length
@@ -322,7 +322,7 @@ Constants
322322 AF_INET6
323323
324324 These constants represent the address (and protocol) families, used for the
325- first argument to :func: `.socket `. If the :const: `AF_UNIX ` constant is not
325+ first argument to :func: `~socket .socket `. If the :const: `AF_UNIX ` constant is not
326326 defined then this protocol is unsupported. More constants may be available
327327 depending on the system.
328328
@@ -339,7 +339,7 @@ Constants
339339 SOCK_SEQPACKET
340340
341341 These constants represent the socket types, used for the second argument to
342- :func: `.socket `. More constants may be available depending on the system.
342+ :func: `~socket .socket `. More constants may be available depending on the system.
343343 (Only :const: `SOCK_STREAM ` and :const: `SOCK_DGRAM ` appear to be generally
344344 useful.)
345345
@@ -378,7 +378,7 @@ Constants
378378
379379 Many constants of these forms, documented in the Unix documentation on sockets
380380 and/or the IP protocol, are also defined in the socket module. They are
381- generally used in arguments to the :meth: `setsockopt ` and :meth: `getsockopt `
381+ generally used in arguments to the :meth: `~socket. setsockopt ` and :meth: `~socket. getsockopt `
382382 methods of socket objects. In most cases, only those symbols that are defined
383383 in the Unix header files are defined; for a few symbols, default values are
384384 provided.
@@ -671,7 +671,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
671671
672672 Build a pair of connected socket objects using the given address family, socket
673673 type, and protocol number. Address family, socket type, and protocol number are
674- as for the :func: `.socket ` function above. The default family is :const: `AF_UNIX `
674+ as for the :func: `~socket .socket ` function above. The default family is :const: `AF_UNIX `
675675 if defined on the platform; otherwise, the default is :const: `AF_INET `.
676676
677677 The newly created sockets are :ref: `non-inheritable <fd_inheritance >`.
@@ -767,7 +767,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
767767
768768 Duplicate the file descriptor *fd * (an integer as returned by a file object's
769769 :meth: `~io.IOBase.fileno ` method) and build a socket object from the result. Address
770- family, socket type and protocol number are as for the :func: `.socket ` function
770+ family, socket type and protocol number are as for the :func: `~socket .socket ` function
771771 above. The file descriptor should refer to a socket, but this is not checked ---
772772 subsequent operations on the object may fail if the file descriptor is invalid.
773773 This function is rarely needed, but can be used to get or set socket options on
@@ -832,7 +832,7 @@ The :mod:`socket` module also offers various network-related services:
832832 ``(family, type, proto, canonname, sockaddr) ``
833833
834834 In these tuples, *family *, *type *, *proto * are all integers and are
835- meant to be passed to the :func: `.socket ` function. *canonname * will be
835+ meant to be passed to the :func: `~socket .socket ` function. *canonname * will be
836836 a string representing the canonical name of the *host * if
837837 :const: `AI_CANONNAME ` is part of the *flags * argument; else *canonname *
838838 will be empty. *sockaddr * is a tuple describing a socket address, whose
@@ -948,7 +948,7 @@ The :mod:`socket` module also offers various network-related services:
948948.. function :: getprotobyname(protocolname)
949949
950950 Translate an internet protocol name (for example, ``'icmp' ``) to a constant
951- suitable for passing as the (optional) third argument to the :func: `.socket `
951+ suitable for passing as the (optional) third argument to the :func: `~socket .socket `
952952 function. This is usually only needed for sockets opened in "raw" mode
953953 (:const: `SOCK_RAW `); for the normal socket modes, the correct protocol is chosen
954954 automatically if the protocol is omitted or zero.
@@ -1232,7 +1232,7 @@ The :mod:`socket` module also offers various network-related services:
12321232
12331233 Send the list of file descriptors *fds * over an :const: `AF_UNIX ` socket *sock *.
12341234 The *fds * parameter is a sequence of file descriptors.
1235- Consult :meth: `sendmsg ` for the documentation of these parameters.
1235+ Consult :meth: `~socket. sendmsg ` for the documentation of these parameters.
12361236
12371237 .. availability :: Unix, Windows, not Emscripten, not WASI.
12381238
@@ -1246,7 +1246,7 @@ The :mod:`socket` module also offers various network-related services:
12461246
12471247 Receive up to *maxfds * file descriptors from an :const: `AF_UNIX ` socket *sock *.
12481248 Return ``(msg, list(fds), flags, addr) ``.
1249- Consult :meth: `recvmsg ` for the documentation of these parameters.
1249+ Consult :meth: `~socket. recvmsg ` for the documentation of these parameters.
12501250
12511251 .. availability :: Unix, Windows, not Emscripten, not WASI.
12521252
@@ -1965,10 +1965,10 @@ Example
19651965
19661966Here are four minimal example programs using the TCP/IP protocol: a server that
19671967echoes all data that it receives back (servicing only one client), and a client
1968- using it. Note that a server must perform the sequence :func: `.socket `,
1968+ using it. Note that a server must perform the sequence :func: `~socket .socket `,
19691969:meth: `~socket.bind `, :meth: `~socket.listen `, :meth: `~socket.accept ` (possibly
19701970repeating the :meth: `~socket.accept ` to service more than one client), while a
1971- client only needs the sequence :func: `.socket `, :meth: `~socket.connect `. Also
1971+ client only needs the sequence :func: `~socket .socket `, :meth: `~socket.connect `. Also
19721972note that the server does not :meth: `~socket.sendall `/:meth: `~socket.recv ` on
19731973the socket it is listening on but on the new socket returned by
19741974:meth: `~socket.accept `.
0 commit comments