server and client no longer crash or hang on a disconnect