• Private
_server: Server
• data: unknown
Custom data associated with this client. You may set this to anything.
• onClose: () => void
▸ (): void
void
• onError: () => void
▸ (): void
void
• onMessage: (event
: string
| number
, data
: unknown
) => void
▸ (event
, data
): void
Name | Type |
---|---|
event |
string | number |
data |
unknown |
void
• get
id(): number
number
• get
transport(): ITransport
▸ close(): void
Disconnects this client
void
▸ send(event
, data
): void
Sends a message to this client
Name | Type | Description |
---|---|---|
event |
unknown |
Unique identifier for this event. It is best to use a string or number for this, but you can use any type that can be serialized. Recommended type is uint8 (any number between 0 and 255). |
data |
unknown |
Data that will be sent to this client. |
void