WebSocketHandler class

Implemented types

Constructors

WebSocketHandler({Duration connectTimeout = const Duration(seconds: 10), Duration closeTimeout = const Duration(seconds: 2)})

Properties

channel → StreamChannel<String>?
no setteroverride
closeCode → int?
no setteroverride
closeReason → String?
no setteroverride
closeTimeout → Duration
How long close waits for the socket's sink to close. WebSocketChannel.sink.close() never completes if the connection failed or is still pending, so it must not be awaited unbounded.
final
connectTimeout → Duration
How long connect waits for the WebSocket handshake to complete. WebSocket.connect has no timeout of its own, so a connection attempt on a blocked network (e.g. an app in the background on Android 17) could otherwise stay pending forever.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
url → String?
no setteroverride

Methods

close() → Future<void>
override
connect() → Future<void>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setup({required String url}) → Future<void>
override
toString() → String
A string representation of this object.
override

Operators

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