summaryrefslogtreecommitdiffstats
path: root/Doc/library/socket.rst
Commit message (Collapse)AuthorAgeFilesLines
* Improve some grammar in the socket docs (GH-103254)Miss Islington (bot)2023-04-041-4/+4
| | | | | (cherry picked from commit bceb9e00ad2998e5193ad5b477e92a114dd31024) Co-authored-by: Tim Burke <tim.burke@gmail.com>
* gh-96773 Fix documentation of socket backlog (GH-96778)Miss Islington (bot)2023-01-011-2/+2
| | | | | (cherry picked from commit 1d1480fefc6ae77d14d6eff007b180ff5d1cd5d4) Co-authored-by: Mehrdad Moradizadeh <mhrddmoradii@gmail.com>
* [3.10] Docs: Fix backtick errors found by sphinx-lint (GH-97998) (#98373)C.A.M. Gerlach2022-10-171-1/+1
| | | | | | | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>. (cherry picked from commit fa2d43e5184f5eaf3391844ec2400342a1b2ead4) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* [3.10] gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C ↵Łukasz Langa2022-10-051-1/+1
| | | | | | | | | | | type>) (GH-97768) (#97925) :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 0031e62973801d34a9e19ab7bb199e9668e32d7b) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.10] gh-93738: Documentation C syntax (Use `c:struct`) (GH-97772) (#97893)Łukasz Langa2022-10-051-6/+6
| | | | | | Use `c:struct` (cherry picked from commit a0f5599aac2037da715d09733e0a83a9cba7c37a) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.10] gh-91838: Use HTTPS links in docs for resources which redirect to ↵Serhiy Storchaka2022-08-041-1/+1
| | | | | | | | | | | | HTTPS (GH-95527) (GH-95644) If an HTTP link is redirected to a same looking HTTPS link, the latter can be used directly without changes in readability and behavior. It protects from a men-in-the-middle attack. This change does not affect Python examples.. (cherry picked from commit f79547a429d5c90af83a0da821e082cba20d4712) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] Docs: remove redundant "adverb-adjective" hyphens from compound ↵Łukasz Langa2022-07-051-2/+2
| | | | | | | | modifiers (GH-94551) (GH-94558) Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021 (cherry picked from commit 3440d197a55800ecceea3e115e44b4262411359c) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* gh-93183: Adjust wording in socket docs (GH-93832)Miss Islington (bot)2022-06-151-2/+2
| | | | | | | | package => packet Co-authored-by: Victor Norman (cherry picked from commit cdd39843073fc27b8e4a887d5d3b7992cb2ced60) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
* Remove the execution bit to some socket-related files. (GH-93368)Miss Islington (bot)2022-06-011-0/+0
| | | | | (cherry picked from commit 5247389369ac3da35c44f7c0d8f4facc0300883a) Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-92417: `socket` docs: remove references to Python <3.3 (GH-92544) (GH-92969)Miss Islington (bot)2022-05-191-2/+2
| | | | | (cherry picked from commit 639b62c9c479e38a6f91a80b261097574a1e7ac7) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.10] bpo-45772: socket.socket should be a class instead of a function ↵Miss Islington (bot)2021-11-131-1/+1
| | | | | | | | | | | | | | | | (GH-23960) (GH-29542) * [bpo-45772](): socket.socket should be a class instead of a function Currently `socket.socket` is documented as a function, but it is really a class (and thus has function-like usage to construct an object). This correction would ensure that Python projects that are interlinking Python's documentation can properly locate `socket.socket` as a type. (cherry picked from commit 4c792f39e688b11c7c19e411ed4f76a7baa44638) Co-authored-by: Hong Xu <hong@topbug.net> Automerge-Triggered-By: GH:asvetlov
* bpo-41983: add availability info to socket docs (GH-27519) (GH-29136)Miss Islington (bot)2021-10-211-0/+4
| | | | | | | | * add availability info to AF_PACKET section * add availability for AF_QIPCRTR as well (cherry picked from commit 51375388bee7287be2d942906b48c8cf3f691e8b) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* [doc] Fix gethostbyname_ex description (GH-28700) (GH-28742)Miss Islington (bot)2021-10-051-2/+2
| | | | | | It seems part of `gethostbyname_ex` doc was copied from `gethostbyaddr`. The latter has an `ip_address` parameter whereas the former doesn't. (cherry picked from commit 4103280b83e1419bef535a42813d6dbe83bfe880) Co-authored-by: Andre Delfino <adelfino@gmail.com>
* bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515) (GH-28523)Miss Islington (bot)2021-09-231-1/+1
| | | | | | | | | | Replace old names when they refer to actual versions of macOS. Keep historical names in references to older versions. Co-authored-by: Patrick Reader <_@pxeger.com> (cherry picked from commit 36122e18148c5b6c78ebce1d36d514fd7cf250f5) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-40635: Fix getfqdn() docstring and docs (GH-27971)Miss Islington (bot)2021-08-261-2/+3
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit fdcb675eed47b1f6054fae381af4388b16a6fff4) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* bpo-44740: Lowercase "internet" and "web" where appropriate. (GH-27378) ↵Miss Islington (bot)2021-07-261-5/+5
| | | | | | | | (GH-27380) Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 11749e2dc20ad6a76e9a39e948853e89b2b4bbed) Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079)Miss Islington (bot)2021-07-141-0/+2
| | | | | (cherry picked from commit d59d7374a364c4e5c2b9a83d8e4543ee494285b8) Co-authored-by: Shane Harvey <shnhrv@gmail.com>
* [3.10] bpo-44559: [Enum] revert enum module to 3.9 (GH-27010)Ethan Furman2021-07-041-2/+2
| | | * [Enum] revert enum module to 3.9
* bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)Miss Islington (bot)2021-06-201-0/+3
| | | | | | Co-authored-by: Pablo Galindo <pablogsal@gmail.com> (cherry picked from commit a317778fd58b1c6b250feffbdb4ecf15e293ef48) Co-authored-by: Georg Sauthoff <mail@georg.so>
* bpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to right ↵Saiyang Gou2021-04-221-23/+26
| | | | section (GH-22608)
* bpo-40066: Enum: modify `repr()` and `str()` (GH-22392)Ethan Furman2021-03-311-2/+2
| | | | | | | | | * Enum: streamline repr() and str(); improve docs - repr() is now ``enum_class.member_name`` - stdlib global enums are ``module_name.member_name`` - str() is now ``member_name`` - add HOW-TO section for ``Enum`` - change main documentation to be an API reference
* bpo-43571: Add IPPROTO_MPTCP macro (GH-24946)Rui Cunha2021-03-201-0/+3
| | | Add IPPROTO_MPTCP constant when defined in the system headers.
* bpo-42393: Raise OverflowError iso. DeprecationWarning on overflow in ↵Erlend Egeberg Aasland2020-12-311-10/+6
| | | | socket.ntohs and socket.htons (GH-23980)
* [doc] Fix a few margins due to bad markup (GH-23619)Andre Delfino2020-12-171-5/+5
|
* bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)Christian Heimes2020-11-201-1/+6
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-40901: Describe what "interface name" means on Windows (GH-20694)Jakub Stasiak2020-10-191-0/+19
|
* bpo-40204: Add :noindex: in the documentation (GH-21859)Victor Stinner2020-08-131-0/+2
| | | | | | | | | | Add :noindex: to duplicated documentation to fix "duplicate object description" errors. For example, fix this Sphinx 3 issue: Doc/library/configparser.rst:1146: WARNING: duplicate object description of configparser.ConfigParser.optionxform, other instance in library/configparser, use :noindex: for one of them
* bpo-40291: Add support for CAN_J1939 sockets (GH-19538)karl ding2020-04-291-1/+18
| | | | Add support for CAN_J1939 sockets that wrap SAE J1939 protocol functionality provided by Linux 5.4+ kernels.
* bpo-25780: Expose CAN_RAW_JOIN_FILTERS in the socket module (GH-19190)Zackery Spytz2020-04-091-0/+11
| | | Co-Authored-By: Stefan Tatschner <stefan@rumpelsepp.org>
* bpo-34788: Add support for scoped IPv6 addresses (GH-13772)opavlyuk2020-02-261-10/+10
| | | Automerge-Triggered-By: @asvetlov
* bpo-39348: Fix code highlight for the SOCK_NONBLOCK example (GH-18018)Oz N Tiram2020-01-151-1/+3
| | | | | | | | | | | The previous double colon was wrongly place directly after Therefore. Which produced a block without syntax highlighting. This fixes it by separating the double colon from the text. As a result, sphinx now properly highlights the python code. https://bugs.python.org/issue39348
* Remove use of deprecated `array.fromstring` method (GH-17332)David Coles2019-11-261-2/+2
|
* bpo-38600: NULL -> ``NULL``. (GH-17001)Serhiy Storchaka2019-10-301-3/+3
| | | Also fix some other formatting.
* bpo-28724: Add methods send_fds and recv_fds to the socket module (GH-12889)Joannah Nanjekye2019-09-111-0/+23
| | | | | | | The socket module now has the socket.send_fds() and socket.recv.fds() functions. Contributed by Joannah Nanjekye, Shinya Okano (original patch) and Victor Stinner. Co-Authored-By: Victor Stinner <vstinner@redhat.com>
* bpo-37085: Expose SocketCAN bcm_msg_head flags (#13646)karl ding2019-07-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Expose the CAN_BCM SocketCAN constants used in the bcm_msg_head struct flags (provided by <linux/can/bcm.h>) under the socket library. This adds the following constants with a CAN_BCM prefix: * SETTIMER * STARTTIMER * TX_COUNTEVT * TX_ANNOUNCE * TX_CP_CAN_ID * RX_FILTER_ID * RX_CHECK_DLC * RX_NO_AUTOTIMER * RX_ANNOUNCE_RESUME * TX_RESET_MULTI_IDX * RX_RTR_FRAME * CAN_FD_FRAME The CAN_FD_FRAME flag was introduced in the 4.8 kernel, while the other ones were present since SocketCAN drivers were mainlined in 2.6.25. As such, it is probably unnecessary to guard against these constants being missing.
* bpo-37390: Add audit event table to documentations (GH-14406)Steve Dower2019-06-271-15/+15
| | | Also updates some (unreleased) event names to be consistent with the others.
* bpo-37345: Add formal UDPLITE support (GH-14258)Gabe Appleton2019-06-241-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment you can definitely use UDPLITE sockets on Linux systems, but it would be good if this support were formalized such that you can detect support at runtime easily. At the moment, to make and use a UDPLITE socket requires something like the following code: ``` >>> import socket >>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136) >>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136) >>> a.bind(('localhost', 44444)) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.setsockopt(136, 10, 16) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.setsockopt(136, 10, 32) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.setsockopt(136, 10, 64) >>> b.sendto(b'test'*256, ('localhost', 44444)) ``` If you look at this through Wireshark, you can see that the packets are different in that the checksums and checksum coverages change. With the pull request that I am submitting momentarily, you could do the following code instead: ``` >>> import socket >>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE) >>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE) >>> a.bind(('localhost', 44444)) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.set_send_checksum_coverage(16) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.set_send_checksum_coverage(32) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.set_send_checksum_coverage(64) >>> b.sendto(b'test'*256, ('localhost', 44444)) ``` One can also detect support for UDPLITE just by checking ``` >>> hasattr(socket, 'IPPROTO_UDPLITE') ``` https://bugs.python.org/issue37345
* bpo-37007: Implement socket.if_nametoindex(), if_indextoname() and ↵Zackery Spytz2019-05-291-3/+12
| | | | if_nameindex() on Windows (GH-13522)
* Fix typo in docs for socket.CAN_RAW_FD_FRAMES (GH-13635)karl ding2019-05-281-1/+1
| | | | There is an extra "one" in the text description for the constant socket.CAN_RAW_FD_FRAMES
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-0/+28
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-20582: add link for manpage for flags on getnameinfo() (GH-11977)Emmanuel Arias2019-04-111-0/+2
|
* BPO-17561: set create_server backlog default to None (GH-12735)Giampaolo Rodola2019-04-091-1/+1
| | | | | | | | | It turns out doing socket.listen(0) does not equal to "choose a reasonable default". It actually means "set backlog to 0". As such set backlog=None as the default for socket.create_server. Fixes the following BB failures: https://github.com/python/cpython/pull/11784#issuecomment-481036369 Ref. BPO-1756, GH-11784.
* bpo-35934: Add socket.create_server() utility function (GH-11784)Giampaolo Rodola2019-04-081-1/+44
|
* bpo-11233: Create availability directive for documentation (GH-9692)Cheryl Sabella2018-10-121-27/+27
| | | | | | Replace "Availability: xxx" with ".. availability:: xxx" in the doc. Original patch by Georg Brandl. Co-Authored-By: Georg Brandl <georg@python.org>
* bpo-31425: fix versionadded in docs and add attribution in NEWS (GH-9595)Tal Einat2018-09-261-1/+1
|
* bpo-31425: Expose AF_QIPCRTR in socket module (GH-3706)Bjorn Andersson2018-09-261-0/+14
| | | | | | The AF_QIPCRTR address family was introduced in Linux v4.7. Co-authored-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* closes bpo-25041: Document AF_PACKET socket address format. (GH-4092)Cheryl Sabella2018-09-121-10/+35
|
* bpo-33921: Clarify how to bind to all interfaces using socket (GH-7877)johnthagen2018-07-281-6/+7
| | | Clarify how to bind to all interfaces using socket
* bpo-32394: Remove some TCP options on old version Windows. (GH-5523)animalize2018-02-261-0/+7
|
* bpo-32221: makeipaddr(): remove interface part + speedup (GH-5449) (#5449)Коренберг Марк2018-02-121-0/+15
|