initial commit
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
|
||||
#ifndef SERVICE_HPP_QWERTY
|
||||
#define SERVICE_HPP_QWERTY
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
|
||||
class Handler {
|
||||
public:
|
||||
void Handle(int sock);
|
||||
};
|
||||
|
||||
class Service {
|
||||
private:
|
||||
int port;
|
||||
int sock;
|
||||
public:
|
||||
explicit Service(int port);
|
||||
std::expected<void, std::string> Bind(void);
|
||||
std::expected<void, std::string> Listen(Handler *handler);
|
||||
~Service();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user