Skip to content

SDLNet_GetStreamSocketPendingWrites doesn't work as expected #90

@captain0xff

Description

@captain0xff

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions