Server
class Server
Properties
| protected RateLimiter|null | $rateLimiter | Cached rate limiter instance. |
Methods
void
void
void
void
void
void
ensureWithinConnectionLimit(Connection $connection)
Ensure the server is within the connection limit.
void
ensureWithinRateLimit(Connection $connection)
Ensure the connection is within the message rate limit.
void
Details
at line 33
__construct(ChannelManager $channels, EventHandler $handler)
Create a new server instance.
at line 42
void
open(Connection $connection)
Handle a client connection.
at line 70
void
message(Connection $from, string $message)
Handle a new message received by the connected client.
at line 117
void
control(Connection $from, int $opcode)
Handle a low-level WebSocket control frame.
at line 135
void
close(Connection $connection)
Handle a client disconnection.
Called from WebSocketHandler::onClose() when the client has already disconnected. Only cleans up Reverb state — does NOT try to close the connection again (the fd is already gone).
at line 158
void
error(Connection $connection, Throwable $exception)
Handle an error.
at line 186
protected void
ensureWithinConnectionLimit(Connection $connection)
Ensure the server is within the connection limit.
Uses SharedState for global connection counting across workers.
at line 207
protected void
ensureWithinRateLimit(Connection $connection)
Ensure the connection is within the message rate limit.
at line 233
protected void
verifyOrigin(Connection $connection)
Verify the origin of the connection.