Skip to content

Wait for websockets to close on server stop#1171

Open
DavidPetkovsek wants to merge 3 commits intoCrowCpp:masterfrom
DavidPetkovsek:bug/close-websockets-on-stop
Open

Wait for websockets to close on server stop#1171
DavidPetkovsek wants to merge 3 commits intoCrowCpp:masterfrom
DavidPetkovsek:bug/close-websockets-on-stop

Conversation

@DavidPetkovsek
Copy link
Copy Markdown
Contributor

The bug is a race between close_websockets() in app.h and stopping the io_context/io_service objects that would actually send the close frame.

This change makes it so then the close frame for this function uses an alternative call that contains a promise that is used to avoid a race.

If it takes too long (5 seconds) it will proceed anyway and no close frame will be provided and a crow log is added.

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

Successfully merging this pull request may close these issues.

1 participant