five-on-it / apps/server/src/rtc-transport / RtcConnection
Interface: RtcConnection
Defined in: apps/server/src/rtc-transport.ts:73
A connection whose unreliable frames may go over a WebRTC data channel (see the module documentation).
Extends
Properties
lossy
readonlylossy:boolean
Defined in: apps/server/src/rtc-transport.ts:75
Whether the unreliable frames go over the channel now, and so may be lost, duplicated or reordered.
Overrides
rtcState
readonlyrtcState:RtcState
Defined in: apps/server/src/rtc-transport.ts:81
Where the unreliable frames go now.
Methods
buffered()?
optionalbuffered():number
Defined in: packages/protocol/src/transport.ts:53
Bytes sent and not yet on their way (a WebSocket's buffered amount); a transport that cannot tell leaves it out.
Returns
number
Inherited from
close()
close():
void
Defined in: packages/protocol/src/transport.ts:51
Closes the connection; the close listener fires on both ends.
Returns
void
Inherited from
dropRtc()
dropRtc():
void
Defined in: apps/server/src/rtc-transport.ts:79
Drops the server's side of the channel without telling the client, and falls back (the debug command rtcDrop).
Returns
void
onClose()
onClose(
handler):void
Defined in: packages/protocol/src/transport.ts:49
Registers the single close listener.
Parameters
handler
() => void
Returns
void
Inherited from
onLossyChange()
onLossyChange(
handler):void
Defined in: apps/server/src/rtc-transport.ts:77
Registers a listener of the changes of RtcConnection.lossy (the channel opened; a fall back).
Parameters
handler
(lossy) => void
Returns
void
onMessage()
onMessage(
handler):void
Defined in: packages/protocol/src/transport.ts:47
Registers the single receiver of incoming frames.
Parameters
handler
(message) => void
Returns
void
Inherited from
refuse()
refuse(
code,reason):void
Defined in: apps/server/src/http.ts:122
Closes the connection with a WebSocket close code and a reason.
Parameters
code
number
reason
string
Returns
void
Inherited from
send()
send(
channel,message):void
Defined in: packages/protocol/src/transport.ts:45
Sends one frame. unreliable frames may be dropped or reordered by a future transport; today every transport delivers both channels reliably and in order.
Parameters
channel
"reliable" | "unreliable"
message
Returns
void