Skip to content
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

Allow to send messages to a specific target #58

Closed
herr-seppia opened this issue Nov 24, 2021 · 2 comments · Fixed by #65
Closed

Allow to send messages to a specific target #58

herr-seppia opened this issue Nov 24, 2021 · 2 comments · Fixed by #65
Labels
team:WebTech End to End UX / UI and blockchain

Comments

@herr-seppia
Copy link
Member

Describe what you want implemented
The Peer API should expose a send method to "broadcast" a message to a specific target.

Describe "Why" this is needed
This is required to handle a ping/pong paradigm useful in the following scenario
Eg:

  • The client caller ask to broadcast a FindBlock message
  • Receives multiple BlockReady responses
  • Replies to only one of the previous responses with a GetBlock message
  • The latter will send back a Block message

Describe alternatives you've considered
The client caller can broadcast a sort of "Ping" message to the network and handle the multiple response.

Additional context
Add any other context or screenshots about the feature request here.

@herr-seppia herr-seppia added the team:WebTech End to End UX / UI and blockchain label Nov 24, 2021
@t00ts
Copy link
Contributor

t00ts commented Nov 30, 2021

Does this function definition seem adequate? @herr-seppia

    /// Send a message to a peer in the network.
    pub async fn send(&self, peer: PeerInfo, message: &[u8])

@herr-seppia
Copy link
Member Author

Does this function definition seem adequate?

Does the client know anything about PeerInfo?
Due to the fact this is a prerequisite for #59, maybe a SocketAddr is enough

What about this signature?

    /// Send a message to a peer in the network.
    pub async fn send(&self, message: &[u8], target: SocketAddr) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:WebTech End to End UX / UI and blockchain
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants