import { Logger } from '../../logger'; import { PeerManager } from './peerManager'; /** * PeerConnectionManager periodically determines whether to open new connections and/or * close existing connections on peers. */ export declare class PeerConnectionManager { private readonly logger; private readonly peerManager; readonly maxPeers: number; readonly keepOpenPeerSlot: boolean; private started; private eventLoopTimer?; constructor(peerManager: PeerManager, logger: Logger | undefined, options: { maxPeers: number; keepOpenPeerSlot?: boolean; }); /** * Start the connection management event loop. Does nothing * if the event loop has already been started. */ start(): void; /** * Stop the connection management event loop. */ stop(): void; private eventLoop; /** * Attempts to connect to a number of peer candidates if it is eligible to * create new connections */ private attemptNewConnections; /** * Maintain a maximum number of peers by disconnecting from peers if we are * connected to more than we should be */ private maintainMaxPeerCount; private connectToEligiblePeers; /** * If we've successfully established both a WebSocket connection and a WebRTC * connection, close the WebSocket connection */ private maintainOneConnectionPerPeer; /** * If we've successfully established a WebSocket connection, * attempt to establish a WebRTC connection */ private attemptToEstablishWebRtcConnectionsToWSPeer; } //# sourceMappingURL=peerConnectionManager.d.ts.map