Updated networking flow (markdown)

Ștefan Talpalaru 2020-03-03 23:18:31 +01:00
parent 28b5e739e5
commit e497cd8c1a
1 changed files with 11 additions and 4 deletions

@ -34,11 +34,18 @@ vendor/nim-libp2p/libp2p/switch.nim:
- awaits Connection.close() - awaits Connection.close()
- awaits Switch.cleanupConn(Connection) - awaits Switch.cleanupConn(Connection)
- Switch.upgradeIncoming(Connection) - Switch.upgradeIncoming(Connection)
- creates a local Multistream instance - creates a local MultistreamSelect instance
- awaits Multistream.select(Connection) - awaits MultistreamSelect.select(Connection)
- for each protocol string key in Switch.secureManagers, calls Multistream.addHandler(proto: string, Switch.upgradeIncoming.securedHandler) - for each protocol string key in Switch.secureManagers, calls MultistreamSelect.addHandler(proto: string, Switch.upgradeIncoming.securedHandler)
- awaits Multistream.handle(Connection) - awaits MultistreamSelect.handle(Connection)
- Switch.upgradeIncoming.securedHandler(Connection, proto: string) - Switch.upgradeIncoming.securedHandler(Connection, proto: string)
- awaits Secure.secure(Connection) and saves the result in `sconn` - this seems to be the same as `conn` - awaits Secure.secure(Connection) and saves the result in `sconn` - this seems to be the same as `conn`
- for each MuxerProvider value in Switch.muxers, calls Multistream.addHandler(MuxerProvider.codec, MuxerProvider) - for each MuxerProvider value in Switch.muxers, calls Multistream.addHandler(MuxerProvider.codec, MuxerProvider)
- awaits Multistream.handle(sconn: Connection) - awaits Multistream.handle(sconn: Connection)
vendor/nim-libp2p/libp2p/multistream.nim:
- MultistreamSelect.select(Connection, proto: seq[string])
- awaits Connection.write(codec: string)
- if there's a `proto` argument, it awaits Connection.writeLp() - only on the first seq item
- awaits and returns Connection.readLp()