spray/spray — pull request #507 by jrudolph (2013-09-11 15:45:11+00:00)
Title: = io: register for OP_CONNECT only after the connection attempt was made, fixes #437

This is necessary because of at least two bugs in the JDK:
* a channel is always connectable before the connection is attempted,
and selecting for `OP_CONNECT` will instantly report connectable
* even worse: after `OP_CONNECT` was reported true, also `finishConnect`
will always return true, even if the connection wasn't yet established

The corresponding issue in akka is https://www.assembla.com/spaces/akka/tickets/3602-io--tcp-connection-establishment-always-succeeds-even-if-endpoint-never-answers for which I will send a PR later