getStatus() public method

Currently returns four entries in the result array: - timed_out (bool): The socket timed out waiting for data - blocked (bool): The socket was blocked - eof (bool): Indicates EOF event - unread_bytes (int): Number of bytes left in the socket buffer
public getStatus ( ) : array
return array Information about existing socket resource.
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}");
 }