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

SDLNet_WaitUntilConnected - Blocks until timeout value for success case, works as expected on failure or with -1 #105

Open
TheGauntt opened this issue Sep 28, 2024 · 0 comments
Assignees

Comments

@TheGauntt
Copy link

TheGauntt commented Sep 28, 2024

Version:
SDL_net edcf67d
SDL - libsdl-org/SDL@7d21a49

Hi,

I'm setting up a simple client/server program on my local machine and noticed that it worked instantly with a timeout of -1, but it'd wait for whatever value I set in timeout otherwise. Here's a barebones example:

// works right away
int connStatus = SDLNet_WaitUntilConnected(clientSocket, -1);

// works after 30s
int connStatus = SDLNet_WaitUntilConnected(clientSocket, 30000);

// works after 2s
int connStatus = SDLNet_WaitUntilConnected(clientSocket, 2000);

Also, if the server is down, all of the above work as expected (instantly). Just the success case hangs.

Workarounds:

  • Use -1 for timeout
  • Use SDLNet_GetConnectionStatus

Let me know if you need any more info - sample code, the computer I'm on, etc.

@icculus icculus self-assigned this Sep 28, 2024
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

No branches or pull requests

2 participants