1212 * is responsible for accepting plaintext TCP/IP connections.
1313 *
1414 * ```php
15- * $server = new TcpServer(8080, $loop);
15+ * $server = new React\Socket\ TcpServer(8080, $loop);
1616 * ```
1717 *
1818 * Whenever a client connects, it will emit a `connection` event with a connection
1919 * instance implementing `ConnectionInterface`:
2020 *
2121 * ```php
22- * $server->on('connection', function (ConnectionInterface $connection) {
22+ * $server->on('connection', function (React\Socket\ ConnectionInterface $connection) {
2323 * echo 'Plaintext connection from ' . $connection->getRemoteAddress() . PHP_EOL;
2424 * $connection->write('hello there!' . PHP_EOL);
2525 * …
@@ -45,7 +45,7 @@ final class TcpServer extends EventEmitter implements ServerInterface
4545 * for more details.
4646 *
4747 * ```php
48- * $server = new TcpServer(8080, $loop);
48+ * $server = new React\Socket\ TcpServer(8080, $loop);
4949 * ```
5050 *
5151 * As above, the `$uri` parameter can consist of only a port, in which case the
@@ -55,7 +55,7 @@ final class TcpServer extends EventEmitter implements ServerInterface
5555 * In order to use a random port assignment, you can use the port `0`:
5656 *
5757 * ```php
58- * $server = new TcpServer(0, $loop);
58+ * $server = new React\Socket\ TcpServer(0, $loop);
5959 * $address = $server->getAddress();
6060 * ```
6161 *
@@ -64,33 +64,33 @@ final class TcpServer extends EventEmitter implements ServerInterface
6464 * preceded by the `tcp://` scheme:
6565 *
6666 * ```php
67- * $server = new TcpServer('192.168.0.1:8080', $loop);
67+ * $server = new React\Socket\ TcpServer('192.168.0.1:8080', $loop);
6868 * ```
6969 *
7070 * If you want to listen on an IPv6 address, you MUST enclose the host in square
7171 * brackets:
7272 *
7373 * ```php
74- * $server = new TcpServer('[::1]:8080', $loop);
74+ * $server = new React\Socket\ TcpServer('[::1]:8080', $loop);
7575 * ```
7676 *
7777 * If the given URI is invalid, does not contain a port, any other scheme or if it
7878 * contains a hostname, it will throw an `InvalidArgumentException`:
7979 *
8080 * ```php
8181 * // throws InvalidArgumentException due to missing port
82- * $server = new TcpServer('127.0.0.1', $loop);
82+ * $server = new React\Socket\ TcpServer('127.0.0.1', $loop);
8383 * ```
8484 *
8585 * If the given URI appears to be valid, but listening on it fails (such as if port
8686 * is already in use or port below 1024 may require root access etc.), it will
8787 * throw a `RuntimeException`:
8888 *
8989 * ```php
90- * $first = new TcpServer(8080, $loop);
90+ * $first = new React\Socket\ TcpServer(8080, $loop);
9191 *
9292 * // throws RuntimeException because port is already in use
93- * $second = new TcpServer(8080, $loop);
93+ * $second = new React\Socket\ TcpServer(8080, $loop);
9494 * ```
9595 *
9696 * Note that these error conditions may vary depending on your system and/or
@@ -102,7 +102,7 @@ final class TcpServer extends EventEmitter implements ServerInterface
102102 * for the underlying stream socket resource like this:
103103 *
104104 * ```php
105- * $server = new TcpServer('[::1]:8080', $loop, array(
105+ * $server = new React\Socket\ TcpServer('[::1]:8080', $loop, array(
106106 * 'backlog' => 200,
107107 * 'so_reuseport' => true,
108108 * 'ipv6_v6only' => true
0 commit comments