first commit
This commit is contained in:
28
ClientTester/EchoClientTester/Program.cs
Normal file
28
ClientTester/EchoClientTester/Program.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using ClientTester.EchoDummyService;
|
||||
using Serilog;
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.WriteTo.Console()
|
||||
.CreateLogger();
|
||||
|
||||
const string SERVER_IP = "localhost";
|
||||
const int SERVER_PORT = 9500;
|
||||
const string CONNECTION_KEY = "game";
|
||||
const int CLIENT_COUNT = 1000;
|
||||
|
||||
var cts = new CancellationTokenSource();
|
||||
Console.CancelKeyPress += (_, e) =>
|
||||
{
|
||||
e.Cancel = true;
|
||||
Log.Warning("[SHUTDOWN] Ctrl+C 감지, 종료 중...");
|
||||
cts.Cancel();
|
||||
};
|
||||
|
||||
var service = new DummyClientService(CLIENT_COUNT, SERVER_IP, SERVER_PORT, CONNECTION_KEY, 100);
|
||||
|
||||
await service.RunAsync(cts.Token);
|
||||
|
||||
service.PrintStats();
|
||||
service.Stop();
|
||||
|
||||
Log.CloseAndFlush();
|
||||
Reference in New Issue
Block a user