Ejemplo n.º 1
0
 public function read()
 {
     $this->_buffer .= $result = $this->_connection->receive();
     if (!empty($result)) {
         $this->_process();
     }
 }
Ejemplo n.º 2
0
 public function __construct($address, $timeout = 10)
 {
     $this->_url = @parse_url($address);
     if (!$this->_url) {
         throw new \InvalidArgumentException('Given $address is not valid url.');
     }
     parent::__construct($this->_url['host'], isset($this->_url['port']) ? $this->_url['port'] : 80, isset($this->_url['scheme']) && $this->_url['scheme'] == 'https' ? 'ssl' : 'tcp', $timeout);
 }