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_GetStreamSocketPendingWrites doesn't work as expected #90

Open
captain0xff opened this issue Mar 8, 2024 · 0 comments
Open

SDLNet_GetStreamSocketPendingWrites doesn't work as expected #90

captain0xff opened this issue Mar 8, 2024 · 0 comments

Comments

@captain0xff
Copy link
Contributor

I made a basic echo server with stream sockets. I made it such that when the user types "quit" both the server and the client should clean-up and close. Now, the issue is that if I call SDLNet_DestroyStreamSocket after sending the "quit" message the server never receives it. Even if I guard SDLNet_DestroyStreamSocket with SDLNet_GetStreamSocketPendingWrites. I also tried using SDLNet_WaitUntilStreamSocketDrained but still the "quit" message never gets sent. But everything works as expected if I put SDL_Delay(100) before destroying the socket. So, my guess is SDLNet_GetStreamSocketPendingWrites doesn't work properly if I understood it's usage correctly.

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

1 participant