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

size cannot be greater than 1024 #40

Closed
Pashy83 opened this issue Jul 29, 2021 · 2 comments
Closed

size cannot be greater than 1024 #40

Pashy83 opened this issue Jul 29, 2021 · 2 comments

Comments

@Pashy83
Copy link

Pashy83 commented Jul 29, 2021

When calling ping and specifying size it returns an error if over 1024 bytes. Looking at the ping3 code comments suggest maximum should be around 1450.

This was done on Windows 7 64 Bit SP1 Python 3.8

Traceback (most recent call last):
  File "WindBackTest.py", line 203, in <module>
    test_network(semIPAddress, None)
  File "WindBackTest.py", line 143, in test_network
    pingReturn = ping(semip, timeout=3, size=1440, unit='ms')
  File "C:\Users\Controls\AppData\Local\Programs\Python\Python38\lib\site-packag
es\ping3.py", line 83, in wrapper
    func_return = func(*args, **kwargs)
  File "C:\Users\Controls\AppData\Local\Programs\Python\Python38\lib\site-packag
es\ping3.py", line 304, in ping
    delay = receive_one_ping(sock=sock, icmp_id=icmp_id, seq=seq, timeout=timeou
t)  # in seconds
  File "C:\Users\Controls\AppData\Local\Programs\Python\Python38\lib\site-packag
es\ping3.py", line 83, in wrapper
    func_return = func(*args, **kwargs)
  File "C:\Users\Controls\AppData\Local\Programs\Python\Python38\lib\site-packag
es\ping3.py", line 220, in receive_one_ping
    recv_data, addr = sock.recvfrom(1024)
OSError: [WinError 10040] A message sent on a datagram socket was larger than th
e internal message buffer or some other network limit, or the buffer used to rec
eive a datagram into was smaller than the datagram itself

Line 220 has recvfrom set to expect 1024. There might be others

@Pashy83
Copy link
Author

Pashy83 commented Jul 29, 2021

Sorry 996 is max. 1024 -20 -8

@kyan001
Copy link
Owner

kyan001 commented Aug 6, 2021

Hi @Pashy83 ,

Thank you for the feedback. In version 2.9.3, the buffer size is adjusted to 1500 bytes. This should be enough in most cases. If you think of a different number, please tell me anytime.

@kyan001 kyan001 closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants