Skip to content

(Question) Example for substreamsΒ #1023

@elbaro

Description

@elbaro

According to this stackoverflow,

you generally dial other peers using the switch interface, which will give you a stream to read from and write to,
...
the switch will just use the existing connection and open another muxed stream over it,
...

As I understand this, we can dial multiple times to get multiple substreams on one TCP connection. However libp2p::Swarm::dial_addr(..) does not return a stream. StreamMuxer has open_outbound method but I am unsure how to use this to create several substreams and pass these to Swarm::new.

Can we have an example using several substreams?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions