Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c048d98

Browse files
committed
#17740: fix links to the socket function. Initial patch by Zachary Ware.
1 parent d34941a commit c048d98

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Doc/library/socket.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ platforms.
1818

1919
The Python interface is a straightforward transliteration of the Unix system
2020
call and library interface for sockets to Python's object-oriented style: the
21-
:func:`socket` function returns a :dfn:`socket object` whose methods implement
21+
:func:`.socket` function returns a :dfn:`socket object` whose methods implement
2222
the various socket system calls. Parameter types are somewhat higher-level than
2323
in the C interface: as with :meth:`read` and :meth:`write` operations on Python
2424
files, buffer allocation on receive operations is automatic, and buffer length
@@ -191,7 +191,7 @@ The module :mod:`socket` exports the following constants and functions:
191191
AF_INET6
192192

193193
These constants represent the address (and protocol) families, used for the
194-
first argument to :func:`socket`. If the :const:`AF_UNIX` constant is not
194+
first argument to :func:`.socket`. If the :const:`AF_UNIX` constant is not
195195
defined then this protocol is unsupported. More constants may be available
196196
depending on the system.
197197

@@ -203,7 +203,7 @@ The module :mod:`socket` exports the following constants and functions:
203203
SOCK_SEQPACKET
204204

205205
These constants represent the socket types, used for the second argument to
206-
:func:`socket`. More constants may be available depending on the system.
206+
:func:`.socket`. More constants may be available depending on the system.
207207
(Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be generally
208208
useful.)
209209

@@ -338,7 +338,7 @@ The module :mod:`socket` exports the following constants and functions:
338338
``(family, type, proto, canonname, sockaddr)``
339339

340340
In these tuples, *family*, *type*, *proto* are all integers and are
341-
meant to be passed to the :func:`socket` function. *canonname* will be
341+
meant to be passed to the :func:`.socket` function. *canonname* will be
342342
a string representing the canonical name of the *host* if
343343
:const:`AI_CANONNAME` is part of the *flags* argument; else *canonname*
344344
will be empty. *sockaddr* is a tuple describing a socket address, whose
@@ -425,7 +425,7 @@ The module :mod:`socket` exports the following constants and functions:
425425
.. function:: getprotobyname(protocolname)
426426

427427
Translate an Internet protocol name (for example, ``'icmp'``) to a constant
428-
suitable for passing as the (optional) third argument to the :func:`socket`
428+
suitable for passing as the (optional) third argument to the :func:`.socket`
429429
function. This is usually only needed for sockets opened in "raw" mode
430430
(:const:`SOCK_RAW`); for the normal socket modes, the correct protocol is chosen
431431
automatically if the protocol is omitted or zero.
@@ -464,7 +464,7 @@ The module :mod:`socket` exports the following constants and functions:
464464

465465
Build a pair of connected socket objects using the given address family, socket
466466
type, and protocol number. Address family, socket type, and protocol number are
467-
as for the :func:`socket` function above. The default family is :const:`AF_UNIX`
467+
as for the :func:`.socket` function above. The default family is :const:`AF_UNIX`
468468
if defined on the platform; otherwise, the default is :const:`AF_INET`.
469469
Availability: Unix.
470470

@@ -477,7 +477,7 @@ The module :mod:`socket` exports the following constants and functions:
477477

478478
Duplicate the file descriptor *fd* (an integer as returned by a file object's
479479
:meth:`fileno` method) and build a socket object from the result. Address
480-
family, socket type and protocol number are as for the :func:`socket` function
480+
family, socket type and protocol number are as for the :func:`.socket` function
481481
above. The file descriptor should refer to a socket, but this is not checked ---
482482
subsequent operations on the object may fail if the file descriptor is invalid.
483483
This function is rarely needed, but can be used to get or set socket options on
@@ -1192,10 +1192,10 @@ Example
11921192

11931193
Here are four minimal example programs using the TCP/IP protocol: a server that
11941194
echoes all data that it receives back (servicing only one client), and a client
1195-
using it. Note that a server must perform the sequence :func:`socket`,
1195+
using it. Note that a server must perform the sequence :func:`.socket`,
11961196
:meth:`~socket.bind`, :meth:`~socket.listen`, :meth:`~socket.accept` (possibly
11971197
repeating the :meth:`~socket.accept` to service more than one client), while a
1198-
client only needs the sequence :func:`socket`, :meth:`~socket.connect`. Also
1198+
client only needs the sequence :func:`.socket`, :meth:`~socket.connect`. Also
11991199
note that the server does not :meth:`~socket.sendall`/:meth:`~socket.recv` on
12001200
the socket it is listening on but on the new socket returned by
12011201
:meth:`~socket.accept`.

0 commit comments

Comments
 (0)