commit 9d83f21dfaeca5fa391efb2d1280fb466920a83c Author: flamingcow Date: Sat May 4 23:00:53 2019 -0700 Start of copy in diff --git a/firecgi.h b/firecgi.h new file mode 100644 index 0000000..e0d4da4 --- /dev/null +++ b/firecgi.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include +#include + +#include "fastcgi_request.h" + +namespace firecgi { + +class Server { + public: + Server(int port, const std::function)>& callback, int threads=1, const std::unordered_set& headers={}); + void Serve(); + + private: + void NewConn(int listen_sock, int epoll_fd); + int NewListenSock(); + void ServeInt(); + + const int port_; + const std::function)> callback_; + const int threads_; + const std::unordered_set headers_; +}; + +} // firecgi