Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to shutdown server with code in linux #315

Closed Answered by joseluisq
hanaTsuk1 asked this question in Q&A
Discussion options

You must be logged in to vote

Why not add a cancel_recv to wait_for_signals so that all platforms can directly control the server https://github.com/static-web-server/static-web-server/blob/master/src/server.rs#L602

Because that function was initially thought to just wait for Linux/Unix termination signals only. Later on, Windows support came along which does not have a termination signal concept and uses a channel to wait for an incoming ctrl+c. That's why both defer in implementation.
Anyway, I agree that adding support for a cancel_recv should be convenient for library users to shout down the server gracefully on demand.

I could propose something in the coming weeks, so stay tuned.

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
5 replies
@hanaTsuk1
Comment options

@joseluisq
Comment options

@hanaTsuk1
Comment options

@joseluisq
Comment options

Answer selected by hanaTsuk1
@hanaTsuk1
Comment options

Comment options

You must be logged in to vote
4 replies
@hanaTsuk1
Comment options

@joseluisq
Comment options

@joseluisq
Comment options

@hanaTsuk1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested v2 v2 release linux Linux platform specific
2 participants