write() public method

Writes data to the stream.
public write ( string $data )
$data string Data to write.
Beispiel #1
0
 /**
  * Sends a command to the server
  *
  * @param string $cmd The command to send.
  */
 protected function _sendCmd($cmd)
 {
     $status = $this->_sock->getStatus();
     if ($status['eof']) {
         throw new Exception('Failed to write to socket: connection lost');
     }
     $this->_sock->write($cmd . "\r\n");
     $this->_debug("C: {$cmd}");
 }