From 3d629d122e306386e47db9fff6b3debe41b7c7e1 Mon Sep 17 00:00:00 2001 From: Richard Peters Date: Thu, 24 Oct 2024 11:16:26 +0200 Subject: [PATCH] feat: add selection of TCP echo port to echo_console --- services/echo_console/Main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/echo_console/Main.cpp b/services/echo_console/Main.cpp index 1a61b8178..69084eb2d 100644 --- a/services/echo_console/Main.cpp +++ b/services/echo_console/Main.cpp @@ -177,7 +177,7 @@ ConsoleClientTcp::ConsoleClientTcp(services::ConnectionFactoryWithNameResolver& , hostname(hostname) , tracer(tracer) { - tracer.Trace() << "Connecting to " << hostname; + tracer.Trace() << "Connecting to " << Hostname() << " port " << Port(); tracer.Trace(); connectionFactory.Connect(*this); @@ -191,12 +191,12 @@ ConsoleClientTcp::~ConsoleClientTcp() infra::BoundedConstString ConsoleClientTcp::Hostname() const { - return infra::BoundedConstString(hostname.data(), hostname.size()); + return services::HostFromUrl(infra::BoundedConstString(hostname)); } uint16_t ConsoleClientTcp::Port() const { - return 1234; + return services::PortFromUrl(hostname).ValueOr(1234); } void ConsoleClientTcp::ConnectionEstablished(infra::AutoResetFunction connectionObserver)>&& createdObserver)