mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 13:34:26 +00:00
fix typo in readme
This commit is contained in:
parent
fe3c1d45bb
commit
253aa7cf75
@ -120,7 +120,7 @@ proc createSwitch(ma: MultiAddress): (Switch, PeerInfo) =
|
||||
proc createMplex(conn: Connection): Muxer =
|
||||
# helper proc to create multiplexers,
|
||||
# use this to perform any custom setup up,
|
||||
# su as adjusting timeout or anything else
|
||||
# such as adjusting timeout or anything else
|
||||
# that the muxer requires
|
||||
result = newMplex(conn)
|
||||
|
||||
@ -156,7 +156,7 @@ proc main() {.async, gcsafe.} =
|
||||
let conn = await switch2.dial(switch1.peerInfo, TestCodec) # dial the first node
|
||||
|
||||
await conn.writeLp("Hello!") # writeLp send a lenght prefixed buffer over the wire
|
||||
let msg = cast[string](await conn.readLp()) # readLp reads a lenght prefixed bytes and returns a buffer without the prefix
|
||||
let msg = cast[string](await conn.readLp()) # readLp reads lenght prefixed bytes and returns a buffer without the prefix
|
||||
echo "Remote responded with - ", cast[string](msg)
|
||||
|
||||
await allFutures(switch1.stop(), switch2.stop()) # close connections and shutdown all transports
|
||||
|
Loading…
x
Reference in New Issue
Block a user