Files
stvpn/works/rpcvar/tunclient_test.cpp
T
Олег Бородин eda9b8986b working commit
2026-05-05 11:37:10 +02:00

32 lines
721 B
C++

#include <expected>
#include <string>
#include <chrono>
#include <cstring>
#include <thread>
#include <iostream>
#include <tunclient.hpp>
using namespace std::chrono_literals;
int main(int argc, char** argv) {
TClient cli;
auto createRes = cli.Create("tun10", "10.1.2.1", 30);
if (!createRes) {
std::cerr << "Error: " << createRes.error() << std::endl;
return 1;
}
auto runRes = cli.Run();
if (!runRes) {
std::cerr << "Error: " << runRes.error() << std::endl;
return 1;
}
//std::chrono::milliseconds timesleep(20s);
//std::this_thread::sleep_for(timesleep);
return 0;
}