Networking · interface
Transport
Explained in Networking and rollback.
interface Transportimport type { Transport } from '@driftengine/network';Properties
| Name | Type | Description |
|---|---|---|
statereadonly | TransportState | |
selfreadonly | PeerId | This end's own id, or -1 before a host has assigned one. |
Methods
send
send(to: PeerId, message: Uint8Array): voidQueue a message. Whether it arrives, in order, or at all is the implementation's business.
| Parameter | Type | Description |
|---|---|---|
to | PeerId | |
message | Uint8Array |
drain
drain(into: MessageSink): voidHand every message that has arrived to the sink, oldest first, and clear them.
| Parameter | Type | Description |
|---|---|---|
into | MessageSink |
close
close(): void