Skip to content

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.

MemberSignature
upgradeupgrade(string $entry, mixed $arguments = null, mixed $limits = null, ?array<string> $grants = null, ?string $on = null): void
currentcurrent(): Core\Socket
receivereceive(): ?Core\Socket\Message
sendsend(string $frame): void
sendBytessendBytes(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.