Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function to check if the server is still running after signal is catched #7

Closed
symisc opened this issue Sep 9, 2019 · 4 comments

Comments

@symisc
Copy link

commented Sep 9, 2019

Since you already installed a SIGTERM handler in your TCP server, the host application cannot install another signal handler for SIGTERM. The TCP server class should make public a function say for example is_server_running() which return true if the underlying is serving request or false if a signal is cached and the server will no longer serve request. That way, we can run our cleaning routines without erasing your SIGTERM handler.

@symisc symisc changed the title Add a function to check if the server is still running Add a function to check if the server is still running after signal is catched Sep 9, 2019

@webcpp

This comment has been minimized.

Copy link
Owner

commented Sep 9, 2019

If you need run a shutdown function or some cleaning routines , I can add a functional parameter for the run method.The functional parameter will be called when the tcp server is stopped.

@symisc

This comment has been minimized.

Copy link
Author

commented Sep 9, 2019

@webcpp

This comment has been minimized.

Copy link
Owner

commented Sep 9, 2019

set_shutdown method will be called when the tcp server is stopped.

@symisc

This comment has been minimized.

Copy link
Author

commented Sep 9, 2019

Great. We will move on shortly. One last thing, we found out that if you use _-Ofast -march=native in your Makefile instead of -O3, the resulting binary is faster in most circumstances.

@symisc symisc closed this Sep 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.