0

I'm working with sockets and noticed my program gets 'stuck' sometimes when I'm trying to perform a socket.close(). Is it possible to set a timeout for how long socket.close() is allowed to take before just continuing? Would calling socket.shutdown() just end up fixing the problem?

tyleax
  • 1,556
  • 2
  • 17
  • 45
  • Does this answer your question? [Python socket connection timeout](https://stackoverflow.com/questions/3432102/python-socket-connection-timeout) – KJTHoward Mar 17 '20 at 16:17
  • @KJTHoward that's for `socket.connect()` but it isn't clear if it would work for `socket.close()` – tyleax Mar 17 '20 at 16:20

0 Answers0