If you're using non-blocking, be sure not to turn it on until after you connect, otherwise you will get the mesasge:
PHP Warning: socket_connect() unable to connect [115]: Operation now in progress in file.php on line 123
and socket_connect() will return false (even though it will connect).