Skip to main content

Class: SyncedWebRTCConnections

Hierarchy

  • WebRTCConnections

    SyncedWebRTCConnections

Constructors

constructor

new SyncedWebRTCConnections(db, id, throttle?)

Parameters

NameTypeDefault value
dbDbConnectionundefined
idstringundefined
throttlenumber0

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

NameType
p2string

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
NameType
connRTCPeerConnection
Returns

void

Defined in

js-pkg/packages/driftdb/src/webrtc.ts:109


getConn

getConn(peer): undefined | ChannelSendReceive

Parameters

NameType
peerstring

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

NameType
peerstring

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

NameType
entries[string, ChannelSendReceive][]

Returns

void

Inherited from

WebRTCConnections.setConnMap

Defined in

js-pkg/packages/driftdb/src/webrtc.ts:58


setOnFailure

setOnFailure(func): void

Parameters

NameType
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

NameType
funcOnMessage

Returns

void

Overrides

WebRTCConnections.setOnMessage

Defined in

js-pkg/packages/driftdb/src/webrtc.ts:124


sync

sync(newPeers): void

Parameters

NameType
newPeersstring[]

Returns

void

Defined in

js-pkg/packages/driftdb/src/webrtc.ts:138