Clean shutdown behavior, signal handling
This commit is contained in:
6
server.h
6
server.h
@@ -12,9 +12,11 @@ class Server {
|
||||
public:
|
||||
Server(int port, const std::function<void(Request*)>& callback, int threads=1, const std::unordered_set<std::string_view>& headers={}, int max_request_len=(16*1024));
|
||||
void Serve();
|
||||
void Shutdown();
|
||||
void RegisterSignalHandlers();
|
||||
|
||||
private:
|
||||
void NewConn(int listen_sock, int epoll_fd);
|
||||
Connection *NewConn(int listen_sock, int epoll_fd);
|
||||
int NewListenSock();
|
||||
void ServeInt();
|
||||
|
||||
@@ -23,6 +25,8 @@ class Server {
|
||||
const int threads_;
|
||||
const std::unordered_set<std::string_view> headers_;
|
||||
const int max_request_len_;
|
||||
|
||||
int close_fd_;
|
||||
};
|
||||
|
||||
} // firecgi
|
||||
|
||||
Reference in New Issue
Block a user