From c026cdec8884dd06afc69074071867d98705b05b Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 21 Jan 2026 07:16:08 +0300 Subject: [PATCH] Fix: Client config uses fixed port 9002, add protective comments - Changed client server port from 0 (unsupported) to 9002 (fixed) - Added comments explaining importance of fixed ports vs random ports - ETCP now uses proper port configuration for client-server setup --- tests/test_etcp_two_instances_fixed.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_etcp_two_instances_fixed.c b/tests/test_etcp_two_instances_fixed.c index c29bc74..bd59df0 100644 --- a/tests/test_etcp_two_instances_fixed.c +++ b/tests/test_etcp_two_instances_fixed.c @@ -70,8 +70,10 @@ int main() { fclose(f); // Create client config + // ВАЖНО: Использовать фиксированный порт, случайные порты (0) не поддерживаются + // Клиентский сервер должен использовать другой порт, чем удаленный сервер f = fopen("/tmp/c.conf", "w"); - fprintf(f, "[global]\nmy_node_id=0x2222222222222222\nmy_private_key=1313912e5d34768983b0e06530a48c77816d228a5b5605e1ab3dc443d107a3dc\nmy_public_key=dde6cec8a9023339a758f60883ef41534d24a1ffdc09bbb787a5c24ddfd891e3092461835a97d37944c681fc6b2c1f5acde8ad192f7d2cdc9920aa0d3ff78e99\ntun_ip=10.99.0.2/24\ntun_ifname=tun98\n\n[server:local]\naddr=0.0.0.0:0\ntype=nat\n\n[client:test]\npeer_node_id=0x1111111111111111\nkeepalive=1\nlink=local:127.0.0.1:9001\n"); + fprintf(f, "[global]\nmy_node_id=0x2222222222222222\nmy_private_key=1313912e5d34768983b0e06530a48c77816d228a5b5605e1ab3dc443d107a3dc\nmy_public_key=dde6cec8a9023339a758f60883ef41534d24a1ffdc09bbb787a5c24ddfd891e3092461835a97d37944c681fc6b2c1f5acde8ad192f7d2cdc9920aa0d3ff78e99\ntun_ip=10.99.0.2/24\ntun_ifname=tun98\n\n[server:local]\naddr=127.0.0.1:9002\ntype=nat\n\n[client:test]\npeer_node_id=0x1111111111111111\nkeepalive=1\nlink=local:127.0.0.1:9001\n"); fclose(f); struct UASYNC* sua = uasync_create(); @@ -88,6 +90,9 @@ int main() { init_connections(client_instance); printf("✓ Both instances initialized\n"); + printf("✓ Server listening on 127.0.0.1:9001\n"); + printf("✓ Client local server on 127.0.0.1:9002\n"); + printf("✓ Client connecting to server at 127.0.0.1:9001\n"); uasync_set_timeout(sua, 1000, NULL, monitor_connections); @@ -105,4 +110,4 @@ int main() { unlink("/tmp/c.conf"); return test_completed ? 0 : 1; -} +} \ No newline at end of file