fix(Dispatcher): closing a socket would throw an unintentinal exception.