WebSocketTransport class
This is a mock class to provide a unified interface for js and native usage of this package
- Inheritance
-
- Object
- AbstractTransport
- WebSocketTransport
Constructors
- WebSocketTransport(dynamic url, dynamic serializer, dynamic serializerType, [dynamic additionalHeaders])
-
WebSocketTransport.withCborSerializer(String url, [Map<
String, dynamic> ? additionalHeaders]) -
factory
-
WebSocketTransport.withJsonSerializer(String url, [Map<
String, dynamic> ? additionalHeaders]) -
factory
-
WebSocketTransport.withMsgpackSerializer(String url, [Map<
String, dynamic> ? additionalHeaders]) -
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isOpen → bool
-
This method will return true if the underlying socket has a ready state of open
no setteroverride
- isReady → bool
-
for this transport this is equal to isOpen
no setteroverride
- onConnectionLost → Completer?
-
on connection lost will only complete if the other end closes unexpectedly
no setteroverride
- onDisconnect → Completer?
-
on disconnect will complete whenever the socket connection closes down
no setteroverride
-
onReady
→ Future<
void> -
This future completes as soon as the connection is established and fully initialized
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
{dynamic error}) → Future< void> ? -
Calling close will close the underlying socket connection
override
-
complete(
Completer? onDisconnectCompleter, dynamic error) → void -
for internal use only
is called to complete the private underlying onDisconnect with a void or an error
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
{Duration? pingInterval}) → Future< void> ? -
This method opens the underlying socket connection and prepares all state completers.
override
-
receive(
) → Stream< AbstractMessage> ? -
This method return a Stream that streams all incoming messages as unserialized
objects.
override
-
send(
AbstractMessage message) → void -
This method takes a
message
, serializes it to a JSON and passes it to the underlying socket.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited