Set nonblock on TCP client sockets
Should probably set non-blocking socket options before calling listen
Set nonblock after calling connect, else it returns immediately
Some function calls are deprecated on OS X.
Merge remote-tracking branch 'upstream/v3.0.x' into v3.0.x