• onConnect: (connectionId
: number
) => void
▸ (connectionId
): void
Should be called when a new connection is established.
Name | Type | Description |
---|---|---|
connectionId |
number |
The ID of the connection. |
void
• onDisconnect: (connectionId
: number
) => void
▸ (connectionId
): void
Should be called when a connection is closed.
Name | Type | Description |
---|---|---|
connectionId |
number |
The ID of the connection. |
void
• onMessage: (connectionId
: number
, message
: Uint8Array
) => void
▸ (connectionId
, message
): void
Should be called when a message is received.
Name | Type | Description |
---|---|---|
connectionId |
number |
The ID of the connection. |
message |
Uint8Array |
The message received. |
void
• server: Server
The server this transport is attached to. This is set by the server when the transport is added.
▸ close(connectionId
): void
Closes a connection.
Name | Type | Description |
---|---|---|
connectionId |
number |
The ID of the connection. |
void
▸ getConnections(): number
[]
Gets the IDs of all clients connected to this transport.
number
[]
▸ send(connectionId
, message
): void
Sends a message to a connection.
Name | Type | Description |
---|---|---|
connectionId |
number |
The ID of the connection. |
message |
Uint8Array |
The message to send. |
void
▸ start(): void
Starts the transport.
void
▸ stop(): void
Stops the transport.
void