diff --git a/networking-flow.md b/networking-flow.md index 83904d8..f20a54e 100644 --- a/networking-flow.md +++ b/networking-flow.md @@ -83,6 +83,16 @@ vendor/nim-libp2p/libp2p/switch.nim: - for each MuxerProvider value in Switch.muxers, calls MultistreamSelect.addHandler(MuxerProvider.codec, MuxerProvider) - awaits MultistreamSelect.handle(sconn: Connection) +- Switch.connect(PeerInfo) + - awaits Switch.internalConnect(PeerInfo) + +- Switch.internalConnect(PeerInfo) + - if there is no Connection with the peer in Switch.connections or the existing one is closed, for each Transport in Switch.transports, for each MultiAddress in PeerInfo.addrs, awaits Transport.dial(MultiAddress), then awaits Switch.upgradeOutgoing(Connection) + - awaits Switch.subscribeToPeer(PeerInfo) + +- Switch.subscribeToPeer(PeerInfo) + - awaits PubSub.subscribeToPeer(Connection) + ## multistream vendor/nim-libp2p/libp2p/multistream.nim: