Use socket.settimeout() before you perform a blocking operation to control its timeout. So in your case it sounds like you don't want a timeout for connect(), but one for recv(). – Lukas Graf
Armali
- 19.6k
- 15
- 64
- 185