main: handle cases where the conn might be broken when sending
There seem to be cases where the connection might be closed before it is caught by the handle_connection loop
There seem to be cases where the connection might be closed before it is caught by the handle_connection loop