working commit

This commit is contained in:
2026-04-23 14:53:39 +02:00
parent fa1c3ce9e2
commit cf45872d91
12 changed files with 1786 additions and 26 deletions
+15 -1
View File
@@ -4,11 +4,25 @@
#include <format>
#include <udpclient.hpp>
#include <resolver.hpp>
int main(int argc, char** argv) {
UDPClient cli;
std::string message("Hello");
auto bindRes = cli.Bind("www.gnu.org", 1025);
const std::string hostname("www.gnu.org");
Resolver resolver;
auto resolveRes = resolver.Resolve(hostname);
if (!resolveRes) {
auto msg = std::format("Cannot resolve hostname {}: {}", hostname, resolveRes.error());
std::cerr << std::format("Error: {}", msg) << std::endl;
return 1;
}
auto raddr = resolveRes.value();
auto address = raddr.GetAddress();
auto bindRes = cli.Bind(address, 1025);
if (!bindRes) {
std::cerr << std::format("Error: {}", bindRes.error()) << std::endl;
return 1;