Hooks class abstract interface

WebSocket hooks interface.

It is used to standardize WebSocket events for various platforms.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fallback(Event event) FutureOr
When the request does not support upgrading or fails to upgrade, its return value is the same as that of a normal routing handler, which can be Responsible or Response supported data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose(Peer peer, {int? code, String? reason}) FutureOr<void>
Received a hook from a connected client or actively closed the websocket call on the server side.
onError(Peer peer, dynamic error) FutureOr<void>
Hook for errors from the server side
onMessage(Peer peer, Message message) FutureOr<void>
Hook when receiving messages from connected clients.
onUpgrade(Event event) FutureOr<CreatePeerOptions>
Called when upgrading request to WebSocket, returns CreatePeerOptions.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited