src/Proxy/SOCKS.php
protected function write($line)
    {
        for ($written = 0, $len = strlen($line); $written < $len; $written += $fwrite) {
            $fwrite = fwrite($this->socket, substr($line, $written));
            if ($fwrite === false) {
                throw new \Erebot\Exception('Connection closed by proxy');
            }
        }
        return $written;
    }
protected function write($line)
    {
        for ($written = 0, $len = strlen($line); $written < $len; $written += $fwrite) {
            $fwrite = fwrite($this->socket, substr($line, $written));
            if ($fwrite === false) {
                throw new \Erebot\Exception('Connection closed by proxy');
            }
        }
        return $written;
    }
protected function write ( $ line ) { for ( $ written = 0 , $ len = strlen ( $ line ) ; $ written < $ len ; $ written += $ fwrite ) { $ fwrite = fwrite ( $ this -> socket , substr ( $ line , $ written ) ) ; if ( $ fwrite === false ) { throw new \ Erebot \ Exception ( 'Connection closed by proxy' ) ; } } return $ written ; }
Passes some data to the proxy server.

\param string $line
Data to send.

\retval int
Number of bytes actually sent (this may be lower
that the length of the initial $line if some bytes
could not be sent).
Passes some data to the proxy server .