Skip to content
Advertisement

Connection reset by peer error showing despite using try

I have a server like this:

JavaScript

but the error of

ConnectionResetError: [Errno 104] Connection reset by peer

still occurs on client disconnection, shouldn’t the error be handled by try except ?

If not how else do I handle this error without the script being terminated?

Advertisement

Answer

From this answer I found the following solution:

JavaScript

but I recommend reading the comment by @Remy Lebeau before applying this

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement