Skip to content

Use future::select_all for accept() #24

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lxb007981
Copy link
Contributor

The goal of accept() is to accept a connection from any available listener as soon as possible. In the previous implementation, select! waits on only the current listener and a timer. It forces the executor to wait 1ms if the accept() call on the current listener doesn't return within 1ms, and if no connection is immediately available on the current listener, there will be another minimum 1ms delay.
This pr tries to improve it by using future::select_all to wait on multiple listeners simultaneously and return the first one that completes.

@SudoDios
Copy link
Collaborator

@lxb007981 Thank you.
From now on we don't need to enable time in runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants