stop_detect now closes the ServerSocket, to make sure the channel doesn't block the closing of this state