Class LimitingServer
The LimitingServer decorator wraps a given
ServerInterface and is responsible for limiting and keeping track
of open connections to this server instance.
Whenever the underlying server emits a connection event, it will
check its limits and then either
- keep track of this connection by adding it to the list of open connections
and then forward the
connectionevent - or reject (close) the connection when its limits are exceeded and will
forward an
errorevent instead.
Whenever a connection closes, it will remove this connection from the list of open connections.
`php $server = new LimitingServer($server, 100);
$server->on('connection', function (ConnectionInterface $connection) {
$connection->write('hello there!' . PHP_EOL); … }); `
See also the ServerInterface for more details.
- Evenement\EventEmitter implements Evenement\EventEmitterInterface uses Evenement\EventEmitterTrait
-
React\Socket\LimitingServer
implements
React\Socket\ServerInterface
Namespace: React\Socket
See:
See:
Located at LimitingServer.php
See:
React\Socket\ServerInterfaceSee:
React\Socket\ConnectionInterfaceLocated at LimitingServer.php
public
|
#
__construct(
Instantiates a new LimitingServer. |
public
|
|
public
?string
|
|
public
|
|
public
|
|
public
|
emit(),
listeners(),
on(),
once(),
removeAllListeners(),
removeListener()
|
(),
(),
(),
(),
(),
()
|
$listeners
|