SpryWebSocket constructor

const SpryWebSocket(
  1. WebSocketConnectedCallback onConnection, {
  2. Iterable<String>? protocols,
  3. Duration? pingInterval,
  4. Handler? fallback,
})

Creates a new SpryWebSocket.

  • The handler is the web socket handler, it is called when a web socket connection is established.
  • The protocols is the web socket handshake protocols.
  • The pingInterval see WebSocketChannel.pingInterval.
  • The fallback is the web socket fallback handler, If the Request is not a web socket connection, then it will be handled by the fallback.

Implementation

const SpryWebSocket(
  this.onConnection, {
  this.protocols,
  this.pingInterval,
  this.fallback,
});