SpryWebSocket constructor
const
SpryWebSocket(
- WebSocketConnectedCallback onConnection, {
- Iterable<
String> ? protocols, - Duration? pingInterval,
- Handler? fallback,
Creates a new SpryWebSocket.
- The
handleris the web socket handler, it is called when a web socket connection is established. - The
protocolsis the web socket handshake protocols. - The
pingIntervalseeWebSocketChannel.pingInterval. - The
fallbackis the web socket fallback handler, If theRequestis not a web socket connection, then it will be handled by thefallback.
Implementation
const SpryWebSocket(
this.onConnection, {
this.protocols,
this.pingInterval,
this.fallback,
});