@@ -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
@@ -348,7 +348,7 @@ Constants
348348 AF_INET6
349349
350350 These constants represent the address (and protocol) families, used for the
351- first argument to :func: `.socket `. If the :const: `AF_UNIX ` constant is not
351+ first argument to :func: `~socket .socket `. If the :const: `AF_UNIX ` constant is not
352352 defined then this protocol is unsupported. More constants may be available
353353 depending on the system.
354354
@@ -365,7 +365,7 @@ Constants
365365 SOCK_SEQPACKET
366366
367367 These constants represent the socket types, used for the second argument to
368- :func: `.socket `. More constants may be available depending on the system.
368+ :func: `~socket .socket `. More constants may be available depending on the system.
369369 (Only :const: `SOCK_STREAM ` and :const: `SOCK_DGRAM ` appear to be generally
370370 useful.)
371371
@@ -404,7 +404,7 @@ Constants
404404
405405 Many constants of these forms, documented in the Unix documentation on sockets
406406 and/or the IP protocol, are also defined in the socket module. They are
407- generally used in arguments to the :meth: `setsockopt ` and :meth: `getsockopt `
407+ generally used in arguments to the :meth: `~socket. setsockopt ` and :meth: `~socket. getsockopt `
408408 methods of socket objects. In most cases, only those symbols that are defined
409409 in the Unix header files are defined; for a few symbols, default values are
410410 provided.
@@ -770,7 +770,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
770770
771771 Build a pair of connected socket objects using the given address family, socket
772772 type, and protocol number. Address family, socket type, and protocol number are
773- as for the :func: `.socket ` function above. The default family is :const: `AF_UNIX `
773+ as for the :func: `~socket .socket ` function above. The default family is :const: `AF_UNIX `
774774 if defined on the platform; otherwise, the default is :const: `AF_INET `.
775775
776776 The newly created sockets are :ref: `non-inheritable <fd_inheritance >`.
@@ -866,7 +866,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
866866
867867 Duplicate the file descriptor *fd * (an integer as returned by a file object's
868868 :meth: `~io.IOBase.fileno ` method) and build a socket object from the result. Address
869- family, socket type and protocol number are as for the :func: `.socket ` function
869+ family, socket type and protocol number are as for the :func: `~socket .socket ` function
870870 above. The file descriptor should refer to a socket, but this is not checked ---
871871 subsequent operations on the object may fail if the file descriptor is invalid.
872872 This function is rarely needed, but can be used to get or set socket options on
@@ -931,7 +931,7 @@ The :mod:`socket` module also offers various network-related services:
931931 ``(family, type, proto, canonname, sockaddr) ``
932932
933933 In these tuples, *family *, *type *, *proto * are all integers and are
934- meant to be passed to the :func: `.socket ` function. *canonname * will be
934+ meant to be passed to the :func: `~socket .socket ` function. *canonname * will be
935935 a string representing the canonical name of the *host * if
936936 :const: `AI_CANONNAME ` is part of the *flags * argument; else *canonname *
937937 will be empty. *sockaddr * is a tuple describing a socket address, whose
@@ -1047,7 +1047,7 @@ The :mod:`socket` module also offers various network-related services:
10471047.. function :: getprotobyname(protocolname)
10481048
10491049 Translate an internet protocol name (for example, ``'icmp' ``) to a constant
1050- suitable for passing as the (optional) third argument to the :func: `.socket `
1050+ suitable for passing as the (optional) third argument to the :func: `~socket .socket `
10511051 function. This is usually only needed for sockets opened in "raw" mode
10521052 (:const: `SOCK_RAW `); for the normal socket modes, the correct protocol is chosen
10531053 automatically if the protocol is omitted or zero.
@@ -1331,7 +1331,7 @@ The :mod:`socket` module also offers various network-related services:
13311331
13321332 Send the list of file descriptors *fds * over an :const: `AF_UNIX ` socket *sock *.
13331333 The *fds * parameter is a sequence of file descriptors.
1334- Consult :meth: `sendmsg ` for the documentation of these parameters.
1334+ Consult :meth: `~socket. sendmsg ` for the documentation of these parameters.
13351335
13361336 .. availability :: Unix, Windows, not Emscripten, not WASI.
13371337
@@ -1345,7 +1345,7 @@ The :mod:`socket` module also offers various network-related services:
13451345
13461346 Receive up to *maxfds * file descriptors from an :const: `AF_UNIX ` socket *sock *.
13471347 Return ``(msg, list(fds), flags, addr) ``.
1348- Consult :meth: `recvmsg ` for the documentation of these parameters.
1348+ Consult :meth: `~socket. recvmsg ` for the documentation of these parameters.
13491349
13501350 .. availability :: Unix, Windows, not Emscripten, not WASI.
13511351
@@ -2064,10 +2064,10 @@ Example
20642064
20652065Here are four minimal example programs using the TCP/IP protocol: a server that
20662066echoes all data that it receives back (servicing only one client), and a client
2067- using it. Note that a server must perform the sequence :func: `.socket `,
2067+ using it. Note that a server must perform the sequence :func: `~socket .socket `,
20682068:meth: `~socket.bind `, :meth: `~socket.listen `, :meth: `~socket.accept ` (possibly
20692069repeating the :meth: `~socket.accept ` to service more than one client), while a
2070- client only needs the sequence :func: `.socket `, :meth: `~socket.connect `. Also
2070+ client only needs the sequence :func: `~socket .socket `, :meth: `~socket.connect `. Also
20712071note that the server does not :meth: `~socket.sendall `/:meth: `~socket.recv ` on
20722072the socket it is listening on but on the new socket returned by
20732073:meth: `~socket.accept `.
0 commit comments