mirror of
https://github.com/AlexMacocian/MTSC.git
synced 2026-07-15 14:59:33 +00:00
Implemented a unified message sending method.
Implemented broadcasting handlers to test encrypted communication.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<RootNamespace>MTSC_TestClient</RootNamespace>
|
||||
<StartupObject>MTSC_TestClient.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user