socket_strerror example

function __construct($verb=FALSE, $le=FALSE) {
        parent::__construct(true, $verb$le);
    }

// <!-- --------------------------------------------------------------------------------------- --> // <!-- Private functions --> // <!-- --------------------------------------------------------------------------------------- -->
    function _settimeout($sock) {
        if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
            $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock)));
            @socket_close($sock);
            return FALSE;
        }
        if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
            $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock)));
            @socket_close($sock);
            return FALSE;
        }
        return true;
    }

    
Home | Imprint | This part of the site doesn't use cookies.