Example #1
0
 /**
  * @param string $addr
  * @param int $port
  * @return $this
  * @throws Exceptions\SocketException
  */
 public function bind($addr, $port)
 {
     if (!\socket_bind($this->getSocket(), $addr, $port)) {
         throw SocketException::cantBind($addr, $port);
     }
     return $this;
 }