SDL_net
SDL_net copied to clipboard
SDLNet_GetStreamSocketPendingWrites doesn't work as expected
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.