public static void Main() { ServiceCollection service = new ServiceCollection(); ConfigureServices(service); ServiceProvider serviceProvider = service.BuildServiceProvider(); IServerCommandHandler serverCommandHandler = new ServerCommandHandler(serviceProvider); IServer server = new CommandResponseProtocol.CRServer.Server(serverCommandHandler); RunPropertyModel runPropertyModel = InputAdress(); server.Run(runPropertyModel); }
public void Run(RunPropertyModel runPropertyModel) { _tcpServer = new TCPServer(runPropertyModel.IPAddress, runPropertyModel.Port); _tcpServer.RecieveDataEvent += RecieveClientCommand; _tcpServer.Start(runPropertyModel.ClientsCount); }