Class: SyncedWebRTCConnections
Hierarchy
WebRTCConnections
↳
SyncedWebRTCConnections
Constructors
constructor
• new SyncedWebRTCConnections(db
, id
, throttle?
)
Parameters
Name | Type | Default value |
---|---|---|
db | DbConnection | undefined |
id | string | undefined |
throttle | number | 0 |
Overrides
WebRTCConnections.constructor
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:92
Properties
connMap
• connMap: Map
<string
, ChannelSendReceive
>
Inherited from
WebRTCConnections.connMap
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:35
myId
• myId: string
Inherited from
WebRTCConnections.myId
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:43
peersToLastMsg
• Private
peersToLastMsg: Record
<string
, WrappedPresenceMessage
<any
>> = {}
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:90
presence
• presence: PresenceListener
<string
>
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:89
send
• send: AnyFunc
Inherited from
WebRTCConnections.send
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:66
Methods
addNewConnection
▸ addNewConnection(p2
): ChannelSendReceive
Parameters
Name | Type |
---|---|
p2 | string |
Returns
ChannelSendReceive
Inherited from
WebRTCConnections.addNewConnection
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:45
createFailureHandler
▸ createFailureHandler(): (conn
: RTCPeerConnection
) => void
Returns
fn
▸ (conn
): void
Parameters
Name | Type |
---|---|
conn | RTCPeerConnection |
Returns
void
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:109
getConn
▸ getConn(peer
): undefined
| ChannelSendReceive
Parameters
Name | Type |
---|---|
peer | string |
Returns
undefined
| ChannelSendReceive
Inherited from
WebRTCConnections.getConn
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:54
getPeersToLastMsg
▸ getPeersToLastMsg(): Record
<string
, WrappedPresenceMessage
<any
>>
Returns
Record
<string
, WrappedPresenceMessage
<any
>>
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:147
hasPeer
▸ hasPeer(peer
): boolean
Parameters
Name | Type |
---|---|
peer | string |
Returns
boolean
Inherited from
WebRTCConnections.hasPeer
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:62
refreshConnections
▸ refreshConnections(): void
Returns
void
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:131
setConnMap
▸ setConnMap(entries
): void
Parameters
Name | Type |
---|---|
entries | [string , ChannelSendReceive ][] |
Returns
void
Inherited from
WebRTCConnections.setConnMap
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:58
setOnFailure
▸ setOnFailure(func
): void
Parameters
Name | Type |
---|---|
func | (conn : RTCPeerConnection ) => void |
Returns
void
Inherited from
WebRTCConnections.setOnFailure
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:83
setOnMessage
▸ setOnMessage(func
): void
Parameters
Name | Type |
---|---|
func | OnMessage |
Returns
void
Overrides
WebRTCConnections.setOnMessage
Defined in
js-pkg/packages/driftdb/src/webrtc.ts:124
sync
▸ sync(newPeers
): void
Parameters
Name | Type |
---|---|
newPeers | string [] |
Returns
void