static void Main(string[] args) { { try { _server = new ServerModel(); _listenThread = new Thread(_server.Listen); _listenThread.Start(); } catch (Exception ex) { _server.Disconnect(); Console.WriteLine(ex.Message); } } }
static void Main(string[] args) { { try { _server = new ServerModel(); _serverThread = new Thread(_server.Listen); _serverThread.Start(); _listener = new ListenerModel("127.0.0.1", 8888, _server.Context); _listener.Connect(); var command = new SendValidatorKeyCommand(); _listener.SendCommand(command); } catch (Exception ex) { _server.Disconnect(); Console.WriteLine(ex.Message); } } }
private void btnCloseServer_Click(object sender, EventArgs e) { myServer.Disconnect(); }