|
@@ -73,15 +73,15 @@
|
|
|
if($this->socket_type == static::SERVER){
|
|
|
if(is_null($this->port)){
|
|
|
$res = socket_bind($this->socket, $this->address);
|
|
|
+ $this->throw_if($res);
|
|
|
if(!file_exists($this->address)){
|
|
|
throw new \Exception('Unable to create socket file');
|
|
|
}
|
|
|
chmod($this->address, 0702);
|
|
|
unlink($this->address); // Delete when we are done
|
|
|
}else{
|
|
|
- $res = socket_bind($this->socket, $this->address, $this->port);
|
|
|
+ $this->throw_if(socket_bind($this->socket, $this->address, $this->port));
|
|
|
}
|
|
|
- $this->throw_if($res);
|
|
|
$this->fire('bind', $this);
|
|
|
$this->throw_if(socket_listen($this->socket, $this->max_connections));
|
|
|
$this->fire('listen', $this);
|