-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
55 lines (37 loc) · 1.04 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System.Net.Sockets;
using TCPEcos;
try
{
Console.WriteLine("IP Adresse der ECOS eingeben:");
string ip = Console.ReadLine();
int port = 15471;
TcpClient client = new TcpClient();
client.Connect(ip, port);
Console.WriteLine("Willkommen in der Fernsteuerung!");
Console.WriteLine("------------------------------------------------------------------------------");
EcosLeser leser = new EcosLeser();
Task.Run(() => leser.StartAsync(client));
EcosSchreiber schreiber = new EcosSchreiber();
await schreiber.Schreiben(client);
}
catch(Exception e)
{
Console.WriteLine("Es ist ein Fehler aufgetreten:");
Console.WriteLine(e.Message);
Console.WriteLine("Das Programm wird beendet.");
}
////////////////////////////
/*
await tcpwriter.WriteAsync("help(11, get, switch)");
await tcpwriter.FlushAsync();
nachricht = "";
while (!fertig)
{
Console.WriteLine(await tcpreader.ReadLineAsync());
if (nachricht.Contains("<END"))
{
break;
}
}*/
////////////////////////////