five-on-it / apps/server/src/rtc-peers / PeerConnection
Interface: PeerConnection
Defined in: apps/server/src/rtc-peers.ts:35
A peer connection with its channel, as the peers drive it (werift's in the worker, a fake in the tests).
Properties
bufferedAmount
readonlybufferedAmount:number
Defined in: apps/server/src/rtc-peers.ts:43
Bytes queued on the channel, not yet sent.
Methods
addCandidate()
addCandidate(
candidate):Promise<void>
Defined in: apps/server/src/rtc-peers.ts:39
Adds one of the client's candidates.
Parameters
candidate
candidate
string = ...
sdpMid?
string | null = ...
sdpMLineIndex?
number | null = ...
usernameFragment?
string | null = ...
Returns
Promise<void>
answer()
answer(
offerSdp):Promise<string>
Defined in: apps/server/src/rtc-peers.ts:37
Applies the client's offer and resolves with the answer's SDP (the candidates found meanwhile come by candidate).
Parameters
offerSdp
string
Returns
Promise<string>
close()
close():
void
Defined in: apps/server/src/rtc-peers.ts:45
Closes the connection; no event follows.
Returns
void
send()
send(
data):void
Defined in: apps/server/src/rtc-peers.ts:41
Sends a frame on the channel.
Parameters
data
Uint8Array
Returns
void