add reading server greeting message
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
// Чтение ввода пользователя
|
// Чтение ввода пользователя
|
||||||
|
|||||||
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user