It seems that timeout values can be specified by setting the SO_SNDTIMEO option before calling socket_connect():
<?php
socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => $seconds, 'usec' => $milliseconds));
socket_connect($socket, $address, $port)//...
?>