Visitar URL original
[docs] socket documentation: "packages" -> "packets" · Issue #93183 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20220525182135/https://github.com/python/cpython/issues/93183
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] socket documentation: "packages" -> "packets" #93183

Open
furkanonder opened this issue May 24, 2022 · 0 comments · May be fixed by #92935
Open

[docs] socket documentation: "packages" -> "packets" #93183

furkanonder opened this issue May 24, 2022 · 0 comments · May be fixed by #92935
Labels
docs

Comments

@furkanonder
Copy link
Contributor

@furkanonder furkanonder commented May 24, 2022

Documentation

In the example of the socket.rst, the comment # receive all packages should be changed to # receive all packets and the comment receive a package should be changed to receive a packet.

import socket

# the public network interface
HOST = socket.gethostbyname(socket.gethostname())

# create a raw socket and bind it to the public interface
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
s.bind((HOST, 0))

# Include IP headers
s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)

# receive all packages
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)

# receive a package
print(s.recvfrom(65565))

# disabled promiscuous mode
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)
@furkanonder furkanonder added the docs label May 24, 2022
@erlend-aasland erlend-aasland linked a pull request May 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant