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

Refactor peer listen-loop to detach socket listening. #1550

Open
Tracked by #19
ElFantasma opened this issue Dec 20, 2024 · 0 comments
Open
Tracked by #19

Refactor peer listen-loop to detach socket listening. #1550

ElFantasma opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels
network Issues related to network communication

Comments

@ElFantasma
Copy link
Contributor

Currently each peer listen-loop is awaiting on several possible events, and one of them is the incoming messages from a socket.
Since this await is inside a select! macro, and it is not cancel-safe, it can get cancelled in the middle of a messages being received and the message will be lost.

We should detach this process of message reading from the main listen-loop and instead have a process that reads the socket and pushes a message into a cancel-safe channel for the peer listen-loop to handle it.

@ElFantasma ElFantasma added the network Issues related to network communication label Dec 20, 2024
@ElFantasma ElFantasma self-assigned this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network Issues related to network communication
Projects
Status: No status
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant