WebSocketContext class

Represents a WebSocket session, with the original RequestContext and ResponseContext attached.

Constructors

WebSocketContext(StreamChannel channel, RequestContext request, ResponseContext response)

Properties

channel → StreamChannel
The underlying StreamChannel.
final
hashCode int
The hash code for this object.
no setterinherited
on WebSocketEventTable
Use this to listen for events.
getter/setter pair
onAction Stream<WebSocketAction>
Fired on any WebSocketAction;
no setter
onAuthenticated Stream<void>
Fired when the user authenticates.
no setter
onClose Stream<void>
Fired once the underlying WebSocket closes.
no setter
onData Stream
Fired when any data is sent through channel.
no setter
request → RequestContext
The original RequestContext.
final
response → ResponseContext
The original ResponseContext.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future
Closes the underlying StreamChannel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(String eventName, dynamic data) → void
Sends an arbitrary WebSocketEvent;
sendError(AngelHttpException error) → void
Sends an error event.
toString() String
A string representation of this object.
inherited

Operators

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