Members
(readonly) isConnected :boolean
Returns whether the client is connected.
Type:
- boolean
(readonly) url :string
Returns the server URL.
Type:
- string
Methods
(async) close()
Closes the connection.
(async) connect(url)
Connects to the server.
Parameters:
Name | Type | Description |
---|---|---|
url |
URL | string | The server URL to connect to. |
(async) send(message, type)
Sends a message to the server.
This is an optional method for streams with bidirectional communication.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | The message to send. |
type |
string | The optional message type. |