Implemented a unified message sending method.

Implemented broadcasting handlers to test encrypted communication.
This commit is contained in:
2019-07-19 09:48:42 +03:00
parent 0527a60ae5
commit 7cf668e3c1
15 changed files with 414 additions and 68 deletions
-1
View File
@@ -4,7 +4,6 @@
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>MTSC_TestClient</RootNamespace>
<StartupObject>MTSC_TestClient.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
+18 -2
View File
@@ -1,4 +1,7 @@
using System;
using MTSC.Client;
using MTSC.Client.Handlers;
using MTSC.Logging;
using System;
namespace MTSC_TestClient
{
@@ -6,7 +9,20 @@ namespace MTSC_TestClient
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Client client = new Client();
BroadcastHandler broadcastHandler = new BroadcastHandler(client);
client
.SetServerAddress("127.0.0.1")
.SetPort(555)
.AddHandler(new EncryptionHandler(client))
.AddHandler(broadcastHandler)
.AddLogger(new ConsoleLogger())
.Connect();
while (true)
{
string line = Console.ReadLine();
broadcastHandler.Broadcast(line);
}
}
}
}