Exemplo n.º 1
0
 /**
  * @param string $addr
  * @param int $port
  * @return $this
  * @throws Exceptions\SocketException
  */
 public function connect($addr, $port)
 {
     if (!\socket_connect($this->getSocket(), $addr, $port)) {
         throw SocketException::cantConnect($addr, $port);
     }
     return $this;
 }