This handles unexpected connecting to the wrong port, say port 80 or 4151. It's hard to detect a protocol error when there's no reply. A timeout seems like the most sensible thing to do. The amount of time to wait seems a bit of a challenge.