You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 guardSDLNet_DestroyStreamSocket
withSDLNet_GetStreamSocketPendingWrites
. I also tried usingSDLNet_WaitUntilStreamSocketDrained
but still the "quit" message never gets sent. But everything works as expected if I putSDL_Delay(100)
before destroying the socket. So, my guess isSDLNet_GetStreamSocketPendingWrites
doesn't work properly if I understood it's usage correctly.The text was updated successfully, but these errors were encountered: