Files
firecgi/firecgi.h

28 lines
557 B
C
Raw Normal View History

2019-05-04 23:00:53 -07:00
#pragma once
#include <functional>
#include <memory>
#include <unordered_set>
2019-05-04 23:21:33 -07:00
#include "request.h"
2019-05-04 23:00:53 -07:00
namespace firecgi {
class Server {
public:
Server(int port, const std::function<void(Request*)>& callback, int threads=1, const std::unordered_set<std::string_view>& headers={});
2019-05-04 23:00:53 -07:00
void Serve();
private:
void NewConn(int listen_sock, int epoll_fd);
int NewListenSock();
void ServeInt();
const int port_;
const std::function<void(Request*)> callback_;
2019-05-04 23:00:53 -07:00
const int threads_;
const std::unordered_set<std::string_view> headers_;
};
} // firecgi