Socket.timeout property doesn't work
AS3's Socket class has a public property called timeout, and it doesn't work.
The default value of timeout is 20000 milliseconds. Setting timeout to any other value doesn't change the 20000 millisecond timeout.
You can confirm this easily by attempting to connect to a Socket that doesn't respond. It will always take 20000 milliseconds for it to timeout, even if you set the timeout to a much smaller value, say 1000 or 5000.
There is a workaround.
1. Make your own Timer and listen for TimerEvent.TIMER_COMPLETE.
2. Start the timer as soon as you call connect().
3. In the Event.CONNECT listener, reset the timer.
4. If the TIMER_COMPLETE event fires first, close the socket.