From 9b79d41f97b686e131489bd71318ec1eb10be740 Mon Sep 17 00:00:00 2001 From: ascet-tomsk <118526659+ascet-tomsk@users.noreply.github.com> Date: Mon, 19 Jan 2026 01:01:21 +0700 Subject: [PATCH] add reading server greeting message --- f-cln/Program.cs | 13 ++++++++++++- f-cln/Properties/launchSettings.json | 2 +- f-srv/Properties/launchSettings.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/f-cln/Program.cs b/f-cln/Program.cs index fb65849..da6008c 100644 --- a/f-cln/Program.cs +++ b/f-cln/Program.cs @@ -123,12 +123,23 @@ namespace f_cln await client.ConnectAsync(ip, port); Console.WriteLine("Подключено к серверу"); - Console.WriteLine("Введите текст для отправки (или 'exit' для выхода):"); using var stream = client.GetStream(); using var reader = new StreamReader(stream, Encoding.UTF8); using var writer = new StreamWriter(stream, Encoding.UTF8) { AutoFlush = true }; + { + string? hello = reader.ReadLine(); + if (hello != null && hello.Length > 6) + { + hello = hello.Remove(0, 6); +// hello = hello.Replace("hello ", ""); + Console.WriteLine($"Локальный адрес: {hello}"); + } + } + + Console.WriteLine("Введите текст для отправки (или 'exit' для выхода):"); + while (true) { // Чтение ввода пользователя diff --git a/f-cln/Properties/launchSettings.json b/f-cln/Properties/launchSettings.json index d7b849a..52669a9 100644 --- a/f-cln/Properties/launchSettings.json +++ b/f-cln/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "f-cln": { "commandName": "Project", - "commandLineArgs": "-p 1771" + "commandLineArgs": "--port 1771 -i fe80::215:5dff:fe12:ec9" } } } \ No newline at end of file diff --git a/f-srv/Properties/launchSettings.json b/f-srv/Properties/launchSettings.json index 006574a..3b44b91 100644 --- a/f-srv/Properties/launchSettings.json +++ b/f-srv/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "f-srv": { "commandName": "Project", - "commandLineArgs": "--port 3113 -i 192.168.15.128" + "commandLineArgs": "--port 1771 -i 127.0.1.1" } } } \ No newline at end of file