Open rastinder opened 1 year ago
I hope you don't mind, I edited to add syntax highlighting.
You may have moved way past this by now, but... I don't think you necessarily need async for this, just a timeout so that it's non-blocking. Note that you can have different timeouts for the listening socket (s
), and for the connection socket (conn
), and you can change the timeouts at any time within the code if desired. Adding timeouts probably also means wrapping more network calls in try
/ except
.
if connection drop then i think code remains stuck on name1 = conn.recv_into(buf) but i want it to be unstuck only if connection drops