SpryWebSocket class
Spry WebSocket handler.
The SpryWebSocket is a Handler that handles web socket connections.
Constructors
-
SpryWebSocket(WebSocketConnectedCallback onConnection, {Iterable<
String> ? protocols, Duration? pingInterval, Handler? fallback}) -
Creates a new SpryWebSocket.
const
Properties
- fallback → Handler?
-
Web socket fallback handler.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- onConnection → WebSocketConnectedCallback
-
The WebSocket connected callback.
final
- pingInterval → Duration?
-
pingInterval controls the interval for sending ping signals. If a ping
message is not answered by a pong message from the peer, the WebSocket is
assumed disconnected and the connection is closed with a
goingAwayclose code. When a ping signal is sent, the pong message must be received within pingInterval. It defaults tonull, indicating that ping messages are disabled.final -
protocols
→ Iterable<
String> ? -
Web socket handshake protocols.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
Context context) → Future< void> -
Coverts the WebSocket to a
Handler. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getWebSocketSignatureKeyOrThrow(
Request request) → String - Returns web socket signature key.
-
isWebSocketProtocolConnection(
Request request) → bool - Whether it is a websocket protocol connection.