-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
split the Transport trait #3435
Comments
Currently, the Related issues: |
yes, both of them have a poll method |
I am not entirely opposed to the idea. |
Another thing to consider: To construct a |
Closing this as stale. |
Description
split the
Transport
intoListen
andDial
2 traitsMotivation
currently
Transport
handle listen and dial logic, I think the responsibility of this trait is too heavy and too hard to write a custom transportfor example:
I am writing a relay Transport, like the libp2p crate relay mod but it doesn't need user specify the relay server addr
so I think user combine normal transport like tcp transport with my relay transport, then
when dialing, try tcp transport at first, if fail, try relay
when listening, listen on tcp transport and relay transport too
however, currently libp2p only provide
or_transport
helper method, it can handle dial, but can't work on listeningif split the
Transport
, it will be easier to use my relay "transport"Requirements
Transport
intoListen
andDial
traitOpen questions
after created the transport, the next step is setting the upgrade and auth, if splits the
transport
trait, should we add the upgrade provided method to both traits, or combine the listen and dial instance into atransport
struct then set the upgrade and auth?Are you planning to do it yourself in a pull request?
Maybe
I want to make contribution to libp2p but I am also a newbie and learning libp2p
The text was updated successfully, but these errors were encountered: