Procs
proc dialAndUpgrade(self: Dialer; peerId: Opt[PeerId]; addrs: seq[MultiAddress]; dir = Direction.Out): InternalRaisesFuture[Muxer, (CancelledError, MaError, TransportAddressError, LPError)] {. ...stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Dial address candidates, resolving DNS addresses when configured. Returns the first upgraded muxer, or nil when no address succeeds. Source Edit
proc dialAndUpgrade(self: Dialer; peerId: Opt[PeerId]; hostname: string; addrs: MultiAddress; dir = Direction.Out): InternalRaisesFuture[ Muxer, (CancelledError,)] {....stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Dial one resolved transport address and upgrade it to a muxer. Returns nil when no transport can establish an upgraded connection. Source Edit
proc negotiateStream(self: Dialer; stream: Stream; protos: seq[string]): InternalRaisesFuture[ Stream, (CancelledError, LPError)] {....stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Negotiate one of protos over an open stream. Raises DialFailedError when negotiation selects no supported protocol or the selected protocol's outgoing stream budget is exhausted. Source Edit
proc new(T: type Dialer; localPeerId: PeerId; connManager: ConnManager; peerStore: PeerStore; transports: seq[Transport]; ms: MultistreamSelect; nameResolver: NameResolver = nil): Dialer
- Source Edit
proc tryDial(self: Dialer; peerId: PeerId; addrs: seq[MultiAddress]): InternalRaisesFuture[ Opt[MultiAddress], (DialFailedError, CancelledError)] {....stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Create a protocol stream in order to check if a connection is possible. Doesn't use the Connection Manager to save it. Returns the observed address when the probe succeeds. Source Edit
Methods
method addTransport(self: Dialer; t: Transport) {....raises: [], tags: [], forbids: [].}
- Source Edit
method connect(self: Dialer; address: MultiAddress; allowUnknownPeerId = false): InternalRaisesFuture[ PeerId, (DialFailedError, CancelledError)] {....stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Connects to a peer and retrieve its PeerId Source Edit
method connect(self: Dialer; peerId: PeerId; addrs: seq[MultiAddress]; forceDial = false; reuseConnection = true; dir = Direction.Out): InternalRaisesFuture[ void, (DialFailedError, CancelledError)] {....stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- connect remote peer without negotiating a protocol Source Edit
method dial(self: Dialer; peerId: PeerId; addrs: seq[MultiAddress]; protos: seq[string]; forceDial = false): InternalRaisesFuture[ Stream, (DialFailedError, CancelledError)] {....stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- create a protocol stream and establish a connection if one doesn't exist already Source Edit