add reading server greeting message

This commit is contained in:
ascet-tomsk
2026-01-19 01:01:21 +07:00
parent 27637cab39
commit 9b79d41f97
3 changed files with 14 additions and 3 deletions

View File

@@ -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)
{
// Чтение ввода пользователя

View File

@@ -2,7 +2,7 @@
"profiles": {
"f-cln": {
"commandName": "Project",
"commandLineArgs": "-p 1771"
"commandLineArgs": "--port 1771 -i fe80::215:5dff:fe12:ec9"
}
}
}