private void Run(string[] args) { try { LoadConfiguration(args); Log(string.Format(Strings.SERVER_TITLE, GetType().Assembly.GetName().Version.ToString(3)), ESeverity.INFO); Log(FrameworkVersion(), ESeverity.INFO); Tunnel.Configuration = Configuration; Tunnel.Logger = GlobalLogger; Protocol.ConfigureServer(typeof(Tunnel)); Log(Strings.SERVER_STARTED, ESeverity.INFO); Console.ReadLine(); Tunnel.DisableChecking(); Protocol.UnConfigureServer(); UnLoadConfiguration(); } catch (Exception ex) { if (GlobalLogger != null) { Log(ex.Message, ESeverity.ERROR); Log(ex.ToString(), ESeverity.DEBUG); } else { Console.WriteLine(ex.Message); } } }
/// ----------------------------------------------------------------------------- /// <summary> /// Destruction des entités de test /// </summary> /// <param name="server">le serveur (tunnel)</param> /// <param name="client">le client (tunnel)</param> /// <param name="echo">le serveur d'echo</param> /// <param name="gw">la passerelle</param> /// ----------------------------------------------------------------------------- private void Finalize(ref BdtServer server, ref BdtClient client, ref EchoServer echo, ref GatewayServer gw) { Assert.AreEqual(ChannelServices.RegisteredChannels.Length, 2); client.StopClient(); Tunnel.DisableChecking(); server.Protocol.UnConfigureServer(); server.UnLoadConfiguration(); client.UnLoadConfiguration(); server = null; client = null; Assert.AreEqual(ChannelServices.RegisteredChannels.Length, 0); echo.CloseServer(); Servers.Remove(echo); echo = null; gw.CloseServer(); Servers.Remove(gw); gw = null; }
/// ----------------------------------------------------------------------------- /// <summary> /// Arrêt du serveur /// </summary> /// ----------------------------------------------------------------------------- public void Stop() { Tunnel.DisableChecking(); Protocol.UnConfigureServer(); UnLoadConfiguration(); }