Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6)

Side by Side Diff: Doc/library/socket.rst

Issue 16802: fileno argument to socket.socket() undocumented
Patch Set: Created 4 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`socket` --- Low-level networking interface 1 :mod:`socket` --- Low-level networking interface
2 ================================================ 2 ================================================
3 3
4 .. module:: socket 4 .. module:: socket
5 :synopsis: Low-level networking interface. 5 :synopsis: Low-level networking interface.
6 6
7 7
8 This module provides access to the BSD *socket* interface. It is available on 8 This module provides access to the BSD *socket* interface. It is available on
9 all modern Unix systems, Windows, MacOS, and probably additional platforms. 9 all modern Unix systems, Windows, MacOS, and probably additional platforms.
10 10
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 .. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None) 378 .. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
379 379
380 Create a new socket using the given address family, socket type and protocol 380 Create a new socket using the given address family, socket type and protocol
381 number. The address family should be :const:`AF_INET` (the default), 381 number. The address family should be :const:`AF_INET` (the default),
382 :const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN` or :const:`AF_RDS`. The 382 :const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN` or :const:`AF_RDS`. The
383 socket type should be :const:`SOCK_STREAM` (the default), 383 socket type should be :const:`SOCK_STREAM` (the default),
384 :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` 384 :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_``
385 constants. The protocol number is usually zero and may be omitted or in the 385 constants. The protocol number is usually zero and may be omitted or in the
386 case where the address family is :const:`AF_CAN` the protocol should be one 386 case where the address family is :const:`AF_CAN` the protocol should be one
387 of :const:`CAN_RAW` or :const:`CAN_BCM`. 387 of :const:`CAN_RAW` or :const:`CAN_BCM`. If fileno is specified, the other
388 arguments are ignored, causing the socket with the specified file descriptor
389 to return. Unlike :meth:`fromfd`, fileno will return the same socket and not
390 a duplicate. This may help close a detached socket using
391 :meth:`socket.close()`.
388 392
389 The newly created socket is :ref:`non-inheritable <fd_inheritance>`. 393 The newly created socket is :ref:`non-inheritable <fd_inheritance>`.
390 394
391 .. versionchanged:: 3.3 395 .. versionchanged:: 3.3
392 The AF_CAN family was added. 396 The AF_CAN family was added.
393 The AF_RDS family was added. 397 The AF_RDS family was added.
394 398
395 .. versionchanged:: 3.4 399 .. versionchanged:: 3.4
396 The CAN_BCM protocol was added. 400 The CAN_BCM protocol was added.
397 401
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 1661
1658 - *An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. Lef fler et 1662 - *An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. Lef fler et
1659 al, 1663 al,
1660 1664
1661 both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections 1665 both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections
1662 PS1:7 and PS1:8). The platform-specific reference material for the various 1666 PS1:7 and PS1:8). The platform-specific reference material for the various
1663 socket-related system calls are also a valuable source of information on the 1667 socket-related system calls are also a valuable source of information on the
1664 details of socket semantics. For Unix, refer to the manual pages; for Window s, 1668 details of socket semantics. For Unix, refer to the manual pages; for Window s,
1665 see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers m ay 1669 see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers m ay
1666 want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv 6. 1670 want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv 6.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+