-
Notifications
You must be signed in to change notification settings - Fork 0
Connection.default
km127pl edited this page Aug 13, 2023
·
1 revision
Connection.default
A TCP socket connection to the server.
• new default(socket, server)
| Name | Type |
|---|---|
socket |
Socket |
server |
default |
• Private #state: State = Connection.State.NONE
The state of the connection.
• Readonly id: string
A unique identifier for this connection.
• Readonly server: default
The server to which this connection belongs.
• Readonly socket: Socket
The TCP socket for this connection.
• get connected(): boolean
Whether this connection is connected (i.e. it can send and receive data).
boolean
• get state(): State
The state of the connection.
▸ disconnect(reason?): Promise<boolean>
Disconnect this connection.
| Name | Type | Description |
|---|---|---|
reason? |
string |
The reason for the disconnect. |
Promise<boolean>