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

Add support for blocking sockets #116

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

egnima
Copy link

@egnima egnima commented Feb 4, 2025

As I promised a while ago in Issue #113, here's support for blocking sockets modes, as well as setting OS-handled socket send/receive timeouts. This is my first time contributing to an SDL project, so I'm sorry if I do something wrong!

Functions added:

  • SDLNet_SetSocketBlocking
  • SDLNet_GetSocketBlocking
  • SDLNet_SetBlockingSocketTimeout

All of these accept arguments of pointers to SDLNet_GenericSocket, a new union of socket types, which is also now the paramater type for SDLNet_WaitUntilInputAvailable

simple-http-get.c makes use of blocking sockets now.

PS: I haven't fully tested this code on a Unix system, only Windows, so their might be bugs there.

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.

1 participant