WebSocketClient class

Inheritance
  • Object
  • PlatformInterface
  • WebSocketSupportPlatform
  • WebSocketClient

Constructors

WebSocketClient(WebSocketListener listener)
constructor
WebSocketClient.private(MethodChannelWebSocketSupport instance)
This constructor is only used for testing and shouldn't be accessed by users of the plugin. It may break or change at any time.

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

connect(String serverUrl, {WebSocketOptions options = const WebSocketOptions()}) Future<bool?>
Initialize ws connection to specified server url. If connection was successful, onWsOpened will be invoked.
override
disconnect({int code = 1000, String reason = 'Client done.'}) Future<bool?>
Initialize ws connection close by client. When connection is successfully closed, onWsClosed will be invoked.
override
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

Constants

wrongListenerExceptionCode → const String