28 lines
570 B
C++
28 lines
570 B
C++
|
|
extern "C" {
|
|
#include <arpa/inet.h>
|
|
}
|
|
|
|
#include <expected>
|
|
#include <string>
|
|
#include <cstring>
|
|
#include <iostream>
|
|
|
|
#include <tunnel.hpp>
|
|
#include <service.hpp>
|
|
|
|
int main(int argc, char** argv) {
|
|
Service svc(1025);
|
|
auto bindres = svc.Bind();
|
|
if (!bindres) {
|
|
std::cerr << bindres.error() << std::endl;
|
|
return 1;
|
|
}
|
|
Handler handler;
|
|
auto listres = svc.Listen(&handler);
|
|
if (!listres) {
|
|
std::cerr << listres.error() << std::endl;
|
|
return 1;
|
|
}
|
|
}
|