Skip to content

Commit

Permalink
set recvfrom bufsize to 1500
Browse files Browse the repository at this point in the history
  • Loading branch information
kyan001 committed Aug 6, 2021
1 parent 024f842 commit a1bc23a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion UPDATES.md
Original file line number Diff line number Diff line change
@@ -1,6 1,8 @@
# UPDATES
* 2.9.3:
* Set packet receive buffer size to 1500. ( #40 )
* 2.9.2:
* Converted to a proper package
* Converted to a proper package. ( #38 #39 )
* 2.9.1:
* Bug Fix: macOS is not treated as Linux now.
* 2.9.0:
Expand Down
2 changes: 1 addition & 1 deletion ping3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 217,7 @@ def receive_one_ping(sock: socket, icmp_id: int, seq: int, timeout: int) -> floa
if selected[0] == []: # Timeout
raise errors.Timeout(timeout)
time_recv = time.time()
recv_data, addr = sock.recvfrom(1500)
recv_data, addr = sock.recvfrom(1500) # Single packet size limit is 65535 bytes, but usually the network packet limit is 1500 bytes.
if has_ip_header:
ip_header_raw = recv_data[ip_header_slice]
ip_header = read_ip_header(ip_header_raw)
Expand Down

0 comments on commit a1bc23a

Please sign in to comment.