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

SocketSelector can't wait for writability #2574

Open
mpartel opened this issue Jun 10, 2023 · 0 comments
Open

SocketSelector can't wait for writability #2574

mpartel opened this issue Jun 10, 2023 · 0 comments

Comments

@mpartel
Copy link

mpartel commented Jun 10, 2023

Subject of the issue

Currently I can't write an efficient single-threaded server with SFML, because SocketSelector only lets me wait for a socket to become readable, not writable. If a socket's outgoing buffer gets full, I have to keep trying writes in a loop, which seems wasteful.

The solution is to make SocketSelector::wait() return when a previously full socket becomes writable again.

Your environment

  • Checked code of SFML 2.5.1, 2.6.x and master - all pass only readfds to select().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants