-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
31 lines (30 loc) · 930 Bytes
/
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
using MTSC.Client;
using MTSC.Client.Handlers;
using MTSC.ClientSide;
using MTSC.Common.WebSockets.ClientModules;
using System;
namespace MTSC_TestClient
{
class Program
{
static void Main(string[] args)
{
var client = new Client();
var websocketHandler = new WebsocketHandler();
var chatModule = new ChatModule();
client
.SetServerAddress("127.0.0.1")
.SetPort(800)
.WithReconnectPolicy(ReconnectPolicy.Forever)
.AddHandler(websocketHandler.AddModule(chatModule))
//.AddHandler(new EncryptionHandler())
//.AddHandler(new BroadcastHandler())
.Connect();
while (true)
{
var message = Console.ReadLine();
chatModule.SendMessage(websocketHandler, message);
}
}
}
}