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); await client.ConnectAsync(ip, port);
Console.WriteLine("Подключено к серверу"); Console.WriteLine("Подключено к серверу");
Console.WriteLine("Введите текст для отправки (или 'exit' для выхода):");
using var stream = client.GetStream(); using var stream = client.GetStream();
using var reader = new StreamReader(stream, Encoding.UTF8); using var reader = new StreamReader(stream, Encoding.UTF8);
using var writer = new StreamWriter(stream, Encoding.UTF8) { AutoFlush = true }; 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) while (true)
{ {
// Чтение ввода пользователя // Чтение ввода пользователя

View File

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

View File

@@ -2,7 +2,7 @@
"profiles": { "profiles": {
"f-srv": { "f-srv": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "--port 3113 -i 192.168.15.128" "commandLineArgs": "--port 1771 -i 127.0.1.1"
} }
} }
} }