24 lines
393 B
C++
24 lines
393 B
C++
|
|
#ifndef TSERVICE_HPP
|
|
#define TSERVICE_HPP
|
|
|
|
#include <expected>
|
|
#include <string>
|
|
|
|
#include <sockhand.hpp>
|
|
|
|
class TCPService {
|
|
private:
|
|
int port;
|
|
int sock;
|
|
public:
|
|
explicit TCPService(int port);
|
|
std::expected<void, std::string> Bind(void);
|
|
std::expected<void, std::string> Listen(void);
|
|
void Handle(int sock);
|
|
~TCPService();
|
|
};
|
|
|
|
#endif
|
|
|