Skip to content

Commit 42300bf

Browse files
committed
Merge remote-tracking branch 'origin/master' into stream
* origin/master: [Socket] Suppress notice when binding to a port, fixes #45
2 parents dfd1b98 + 983e450 commit 42300bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Server.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ public function __construct(LoopInterface $loop)
1717

1818
public function listen($port, $host = '127.0.0.1')
1919
{
20-
$this->master = stream_socket_server("tcp://$host:$port", $errno, $errstr);
20+
$this->master = @stream_socket_server("tcp://$host:$port", $errno, $errstr);
2121
if (false === $this->master) {
22-
throw new ConnectionException($errstr, $errno);
22+
$message = "Could not bind to tcp://$host:$port: $errstr";
23+
throw new ConnectionException($message, $errno);
2324
}
2425
stream_set_blocking($this->master, 0);
2526

0 commit comments

Comments
 (0)