@@ -31,10 +31,11 @@ handle multiple concurrent connections without blocking.
3131 * [ resume()] ( #resume )
3232 * [ close()] ( #close )
3333 * [ Server] ( #server )
34- * [ TcpServer] ( #tcpserver )
35- * [ SecureServer] ( #secureserver )
36- * [ LimitingServer] ( #limitingserver )
37- * [ getConnections()] ( #getconnections )
34+ * [ Advanced server usage] ( #advanced-server-usage )
35+ * [ TcpServer] ( #tcpserver )
36+ * [ SecureServer] ( #secureserver )
37+ * [ LimitingServer] ( #limitingserver )
38+ * [ getConnections()] ( #getconnections )
3839* [ Client usage] ( #client-usage )
3940 * [ ConnectorInterface] ( #connectorinterface )
4041 * [ connect()] ( #connect )
@@ -55,8 +56,8 @@ Here is a server that closes the connection if you send it anything:
5556
5657``` php
5758$loop = React\EventLoop\Factory::create();
59+ $socket = new React\Socket\Server('127.0.0.1:8080', $loop);
5860
59- $socket = new React\Socket\TcpServer(8080, $loop);
6061$socket->on('connection', function (ConnectionInterface $conn) {
6162 $conn->write("Hello " . $conn->getRemoteAddress() . "!\n");
6263 $conn->write("Welcome to this amazing server!\n");
@@ -322,10 +323,9 @@ Calling this method more than once on the same instance is a NO-OP.
322323
323324### Server
324325
325- The ` Server ` class implements the [ ` ServerInterface ` ] ( #serverinterface ) and
326- is responsible for accepting plaintext TCP/IP connections.
327- It acts as a facade for the underlying [ ` TcpServer ` ] ( #tcpserver ) and follows
328- its exact semantics.
326+ The ` Server ` class is the main class in this package that implements the
327+ [ ` ServerInterface ` ] ( #serverinterface ) and allows you to accept incoming
328+ streaming connections, such as plaintext TCP/IP or secure TLS connection streams.
329329
330330``` php
331331$server = new Server(8080, $loop);
@@ -461,7 +461,9 @@ See also the [`ServerInterface`](#serverinterface) for more details.
461461 If you want to typehint in your higher-level protocol implementation, you SHOULD
462462 use the generic [ ` ServerInterface ` ] ( #serverinterface ) instead.
463463
464- ### TcpServer
464+ ### Advanced server usage
465+
466+ #### TcpServer
465467
466468The ` TcpServer ` class implements the [ ` ServerInterface ` ] ( #serverinterface ) and
467469is responsible for accepting plaintext TCP/IP connections.
@@ -550,7 +552,7 @@ $server->on('connection', function (ConnectionInterface $connection) {
550552
551553See also the [ ` ServerInterface ` ] ( #serverinterface ) for more details.
552554
553- ### SecureServer
555+ #### SecureServer
554556
555557The ` SecureServer ` class implements the [ ` ServerInterface ` ] ( #serverinterface )
556558and is responsible for providing a secure TLS (formerly known as SSL) server.
@@ -630,7 +632,7 @@ If you use a custom `ServerInterface` and its `connection` event does not
630632meet this requirement, the ` SecureServer ` will emit an ` error ` event and
631633then close the underlying connection.
632634
633- ### LimitingServer
635+ #### LimitingServer
634636
635637The ` LimitingServer ` decorator wraps a given ` ServerInterface ` and is responsible
636638for limiting and keeping track of open connections to this server instance.
@@ -697,7 +699,7 @@ $server->on('connection', function (ConnectionInterface $connection) {
697699});
698700```
699701
700- #### getConnections()
702+ ##### getConnections()
701703
702704The ` getConnections(): ConnectionInterface[] ` method can be used to
703705return an array with all currently active connections.
0 commit comments