Core\Socket
A WebSocket connection from a client to your server. A request calls upgrade to turn itself into a connection that runs a script of its own. That script calls current to get the connection, then receive and send to talk to the client.
Members
5 members.
| Member | Signature |
|---|---|
upgrade | upgrade(string $entry, mixed $arguments = null, mixed $limits = null, ?array<string> $grants = null, ?string $on = null): void |
current | current(): Core\Socket |
receive | receive(): ?Core\Socket\Message |
send | send(string $frame): void |
sendBytes | sendBytes(bytes $frame): void |
Example apps
These complete apps use this class. You can download and run each one.
- Chat: A chat app with rooms, WebSockets and SQLite. One Novis server sends the pages and runs every connection, with no separate WebSocket server and no library.
