Azu::Channel
Inherits HTTP::Handler < Reference < Object
A channel encapsulates a logical unit of work similar to an Endpoint.
Channels manage WebSocket connections, handling multiple instances where a single client may have multiple WebSocket connections open to the application.
Each channel can broadcast to multiple connected clients.
To set up a WebSocket route in your routing service:
ExampleApp.router do
ws "/hi", ExampleApp::ExampleChannel
end
Pings and Pongs: The Heartbeat of WebSockets
After the handshake, either the client or the server can send a ping to the other party. Upon receiving a ping, the recipient must promptly send back a pong. This mechanism ensures that the client remains connected.
Constructors
new(socket : HTTP::WebSocket)
SourceClass methods
Instance methods
Invoked when the connection is closed
socket
Sourcesocket?
Source