Net/Socket.php
public function setTimeout($seconds = null, $microseconds = null)
    {
        if (!is_resource($this->fp)) {
            return $this->raiseError('not connected');
        }

        if ($seconds === null && $microseconds === null) {
            $seconds = (int)$this->timeout;
            $microseconds = (int)(($this->timeout - $seconds) * 1000000);
        } else {
            $this->timeout = $seconds + $microseconds / 1000000;
        }

        if ($this->timeout > 0) {
            return stream_set_timeout($this->fp, (int)$seconds, (int)$microseconds);
        } else {
            return false;
        }
    }
public function setTimeout($seconds = null, $microseconds = null)
    {
        if (!is_resource($this->fp)) {
            return $this->raiseError('not connected');
        }

        if ($seconds === null && $microseconds === null) {
            $seconds = (int)$this->timeout;
            $microseconds = (int)(($this->timeout - $seconds) * 1000000);
        } else {
            $this->timeout = $seconds + $microseconds / 1000000;
        }

        if ($this->timeout > 0) {
            return stream_set_timeout($this->fp, (int)$seconds, (int)$microseconds);
        } else {
            return false;
        }
    }
public function setTimeout ( $ seconds = null , $ microseconds = null ) { if ( ! is_resource ( $ this -> fp ) ) { return $ this -> raiseError ( 'not connected' ) ; } if ( $ seconds === null && $ microseconds === null ) { $ seconds = ( int ) $ this -> timeout ; $ microseconds = ( int ) ( ( $ this -> timeout - $ seconds ) * 1000000 ) ; } else { $ this -> timeout = $ seconds + $ microseconds / 1000000 ; } if ( $ this -> timeout > 0 ) { return stream_set_timeout ( $ this -> fp , ( int ) $ seconds , ( int ) $ microseconds ) ; } else { return false ; } }
Sets the timeout value on socket descriptor,
expressed in the sum of seconds and microseconds

@param integer $seconds Seconds.
@param integer $microseconds Microseconds, optional.

@access public
@return mixed True on success or false on failure or
a PEAR_Error instance when not connected
Sets the timeout value on socket descriptor expressed in the sum of seconds and microseconds