public function write($buf)
    {
        if (!$this->isOpen()) {
            throw new TTransportException('transport is closed');
        }

        $ok = @socket_write($this->socket, $buf);
        if ($ok === false) {
            throw new TTransportException('socket_write failed');
        }
    }
public function write($buf)
    {
        if (!$this->isOpen()) {
            throw new TTransportException('transport is closed');
        }

        $ok = @socket_write($this->socket, $buf);
        if ($ok === false) {
            throw new TTransportException('socket_write failed');
        }
    }
public function write ( $ buf ) { if ( ! $ this -> isOpen ( ) ) { throw new TTransportException ( 'transport is closed' ) ; } $ ok = @ socket_write ( $ this -> socket , $ buf ) ; if ( $ ok === false ) { throw new TTransportException ( 'socket_write failed' ) ; } }
Writes the given data out.

@param string $buf The data to write
@throws TTransportException if writing fails
Writes the given data out .