You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while monkeypatching a 3rd-party module, I observed a different behavior when calling socket.socket.recv(0) and socks.socksocket.recv(0). The former call will return b'' but the latter one will just stuck and never return.
The following code snippet reproduces this issue for me:
import socket
import socks
addr = ("127.0.0.1", 80)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(addr)
r = s.recv(0)
print(r)
s1 = socks.socksocket(socket.AF_INET, socket.SOCK_STREAM)
s1.connect(addr)
r1 = s1.recv(0) # never returns!
print(r1)
I would have expected similar behavior at least when no proxy is used. But I also do not understand what the idea of a recv(0) is, since I have no experience using sockets. So maybe this is as expected?!
(Python 3.9.12, PySocks 1.7.1)
Thanks in advance
Thomas
The text was updated successfully, but these errors were encountered:
Hi there,
while monkeypatching a 3rd-party module, I observed a different behavior when calling
socket.socket.recv(0)
andsocks.socksocket.recv(0)
. The former call will returnb''
but the latter one will just stuck and never return.The following code snippet reproduces this issue for me:
I would have expected similar behavior at least when no proxy is used. But I also do not understand what the idea of a
recv(0)
is, since I have no experience using sockets. So maybe this is as expected?!(Python 3.9.12, PySocks 1.7.1)
Thanks in advance
Thomas
The text was updated successfully, but these errors were encountered: