Exemplo n.º 1
0
            private static void CreateChannel()
            {
                var type = typeof(Type);

                foreach (var entry in RemotingConfiguration.GetRegisteredWellKnownServiceTypes())
                {
                    if (entry.ObjectType == type)
                    {
                        return;
                    }
                }
                var portName  = $"{AppDomain.CurrentDomain.FriendlyName.Replace(".", "-").ToLower()}-{Process.GetCurrentProcess().Id}";
                var objectUri = type.Name.ToLower();
                var client    = new BinaryClientFormatterSinkProvider();
                var server    = new BinaryServerFormatterSinkProvider
                {
                    TypeFilterLevel = TypeFilterLevel.Full
                };
                var config = new Hashtable
                {
                    ["name"]     = string.Empty,
                    ["portName"] = portName,
                    ["tokenImpersonationLevel"] = TokenImpersonationLevel.Impersonation,
                    ["impersonate"]             = true,
                    ["useDefaultCredentials"]   = true,
                    ["secure"]          = true,
                    ["typeFilterLevel"] = TypeFilterLevel.Full
                };
                var ipcChannel = new IpcChannel(config, client, server);

                ChannelServices.RegisterChannel(ipcChannel, true);
                RemotingConfiguration.RegisterWellKnownServiceType(type, objectUri, WellKnownObjectMode.SingleCall);
            }
Exemplo n.º 2
0
 // This function iterates through all the WellKnownService types
 // that were loaded via the RemotingConfiguration.Configure(Remoting.config)
 // file.
 private void ListWellKnownServiceTypes()
 {
     foreach (WellKnownServiceTypeEntry entry in RemotingConfiguration.GetRegisteredWellKnownServiceTypes())
     {
         this.lstOutput.Items.Add(entry.TypeName + " is available at " + entry.ObjectUri);
     }
 }
    public static void Main()
    {
        // Create a 'HttpChannel' object and register it with the
        // channel services.
        ChannelServices.RegisterChannel(new HttpChannel(8086));
        // Record the 'HelloServer' type as 'Singleton' well-known type.
        WellKnownServiceTypeEntry myWellKnownServiceTypeEntry =
            new WellKnownServiceTypeEntry(typeof(HelloServer),
                                          "SayHello",
                                          WellKnownObjectMode.Singleton);

        // Register the remote object as well-known type.
        RemotingConfiguration.RegisterWellKnownServiceType(
            myWellKnownServiceTypeEntry);
        // Retrieve object types registered on the service end
        // as well-known types.
        WellKnownServiceTypeEntry [] myWellKnownServiceTypeEntryCollection =
            RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
        Console.WriteLine("The 'WellKnownObjectMode' of the remote object : "
                          + myWellKnownServiceTypeEntryCollection[0].Mode);
        Console.WriteLine("The 'WellKnownServiceTypeEntry' object: " +
                          myWellKnownServiceTypeEntryCollection[0].ToString());
        Console.WriteLine("Started the Server, Hit <enter> to exit...");
        Console.ReadLine();
    }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            RemotingConfiguration.Configure(CONFIG_FILE, false);
            var clients = RemotingConfiguration.GetRegisteredWellKnownClientTypes();

            if (clients.Length == 0)
            {
                Console.WriteLine("You must specify app.config file with wellknown tag inside a client tag.");
                Console.ReadLine();
                return;
            }

            var services = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();

            if (services.Length == 0)
            {
                Console.WriteLine("You must specify app.config file with wellknown tag inside a service tag.");
                Console.ReadLine();
                return;
            }

            var    central         = (ICentralManager)Activator.GetObject(clients[0].ObjectType, clients[0].ObjectUrl);
            var    broker          = new Broker(central);
            ObjRef objrefWellKnown = RemotingServices.Marshal(broker, services[0].ObjectUri);

            Console.WriteLine("Início do Server Broker.\n Espera de pedidos");
            Console.ReadLine();
        }
        /// <summary>
        /// Initializes communications with the outside world by means of remoting
        /// </summary>
        private void InitializeRemotingCommunications()
        {
            // Read the configuration file.
            RemotingConfiguration.Configure("..\\..\\App.config", false);
            WellKnownServiceTypeEntry[] wkst = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();

            // "Activate" the NameService singleton.
            objectDirectory = (ObjectDirectory)Activator.GetObject(typeof(ObjectDirectory), wkst[0].ObjectUri);

            // Bind the operational test faceade
            objectDirectory.Rebind(this, "OperationalTestFacade");

            // Retreive the directory of messaging channels
            IChannelFactory channelFactory = (IChannelFactory)objectDirectory.Resolve("ChannelFactory");

            // Retreive the Messaging Service channels we want to listen to
            rndfChannel       = channelFactory.GetChannel("RndfNetworkChannel", ChannelMode.Bytestream);
            mdfChannel        = channelFactory.GetChannel("MdfChannel", ChannelMode.Bytestream);
            positionChannel   = channelFactory.GetChannel("PositionChannel", ChannelMode.Bytestream);
            testStringChannel = channelFactory.GetChannel("TestStringChannel", ChannelMode.Vanilla);

            // Create a channel listeners and listen on wanted channels
            channelListener = new MessagingListener();
            rndfToken       = rndfChannel.Subscribe(channelListener);
            mdfToken        = mdfChannel.Subscribe(channelListener);
            //positionToken = positionChannel.Subscribe(channelListener);
            testStringToken = testStringChannel.Subscribe(new StringListener());

            // Show that the navigation system is ready and waiting for input
            Console.WriteLine("   > Remoting Communication Initialized");
        }
        static void Main(string[] args)
        {
            Console.WriteLine("***** SimpleRemoteObjectServer started! *****");
            Console.WriteLine("Hit enter to end.");
            RemotingConfiguration.ApplicationName = "First server app!";

            // Create a new HttpChannel
            HttpChannel c = new HttpChannel(32469);

            ChannelServices.RegisterChannel(c);

            // Register a 'well-known' object.
            RemotingConfiguration.RegisterWellKnownServiceType(
                typeof(SimpleRemotingAsm.RemoteMessageObject),
                "RemoteMsgObj.soap",
                WellKnownObjectMode.SingleCall);

            #region Fun with registration services.
            Console.WriteLine("App Name: {0}",
                              RemotingConfiguration.ApplicationName);
            WellKnownServiceTypeEntry[] WKOs =
                RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
            foreach (WellKnownServiceTypeEntry wko in WKOs)
            {
                Console.WriteLine("Asm name containing WKO: {0}", wko.AssemblyName);
                Console.WriteLine("URL to WKO: {0}", wko.ObjectUri);
                Console.WriteLine("Type of WKO: {0}", wko.ObjectType);
                Console.WriteLine("Mode of WKO: {0}", wko.Mode);
            }
            #endregion

            Console.ReadLine();
        }
    public static void Main()
    {
// <Snippet1>

        // Configure the remoting structure.
        RemotingConfiguration.Configure("server.config");

// </Snippet1>
// <Snippet2>

        // Retrive the array of objects registered as well known types at
        // the service end.
        WellKnownServiceTypeEntry[] myEntries =
            RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
        Console.WriteLine("The number of WellKnownServiceTypeEntries are:"
                          + myEntries.Length);
        Console.WriteLine("The Object Type is:" + myEntries[0].ObjectType);
        Console.WriteLine("The Object Uri is:" + myEntries[0].ObjectUri);
        Console.WriteLine("The Mode is:" + myEntries[0].Mode);

// </Snippet2>

        Console.WriteLine("Press <enter> to exit...");
        Console.ReadLine();
    }
Exemplo n.º 8
0
        /// <summary>
        /// Registers the bootstrap remoting access service.
        /// </summary>
        protected virtual void RegisterRemotingService()
        {
            var bootstrapIpcPort = string.Format("SuperSocket.Bootstrap[{0}]", Math.Abs(AppDomain.CurrentDomain.BaseDirectory.TrimEnd(System.IO.Path.DirectorySeparatorChar).GetHashCode()));

            var serverChannelName = "Bootstrap";

            var serverChannel = ChannelServices.RegisteredChannels.FirstOrDefault(c => c.ChannelName == serverChannelName);

            if (serverChannel != null)
            {
                ChannelServices.UnregisterChannel(serverChannel);
            }

            serverChannel = new IpcServerChannel(serverChannelName, bootstrapIpcPort);
            ChannelServices.RegisterChannel(serverChannel, false);

            AppDomain.CurrentDomain.SetData("BootstrapIpcPort", bootstrapIpcPort);

            var bootstrapProxyType = typeof(RemoteBootstrapProxy);

            if (!RemotingConfiguration.GetRegisteredWellKnownServiceTypes().Any(s => s.ObjectType == bootstrapProxyType))
            {
                RemotingConfiguration.RegisterWellKnownServiceType(bootstrapProxyType, "Bootstrap.rem", WellKnownObjectMode.Singleton);
            }
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            RemotingConfiguration.Configure(CONFIG_FILE, false);
            var services = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();

            if (services.Length == 0)
            {
                Console.WriteLine("You must specify app.config file with wellknown tag inside a service tag.");
                Console.ReadLine();
                return;
            }
            var config   = ConfigurationSettings.AppSettings;
            var type     = config["type"];
            var assembly = config["assembly"];
            var brokers  = new List <IBrokerClient>();

            for (int i = 2; i < config.Count; i++)
            {
                WellKnownClientTypeEntry entry = new WellKnownClientTypeEntry(type, assembly, config[i]);
                brokers.Add((IBrokerClient)Activator.GetObject(entry.ObjectType, entry.ObjectUrl));
            }
            var    central         = new CentralManager(brokers);
            ObjRef objrefWellKnown = RemotingServices.Marshal(central, services[0].ObjectUri);

            Console.WriteLine("Início do Server CentralManager.\n Espera de pedidos");
            Console.ReadLine();
        }
Exemplo n.º 10
0
		public void RegisterWellKnownType()
		{
			TcpChannel chn = null;
			try
			{
				chn = new TcpChannel(1234);
				ChannelServices.RegisterChannel(chn);
				
				// register the SAO
				if(RemotingConfiguration.ApplicationName == null) RemotingConfiguration.ApplicationName = "RemotingConfigurationTest";
				RemotingConfiguration.RegisterWellKnownServiceType(typeof(DerivedWellKnownObject), "WellKnownObject.rem", WellKnownObjectMode.Singleton);
				
				// get the registered services
				WellKnownServiceTypeEntry[] ast = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
				
				bool IsServerRegistered = false;
				foreach(WellKnownServiceTypeEntry aste in ast)
				{
					if(aste.ObjectType == typeof(DerivedWellKnownObject))
					{
						IsServerRegistered = true;
						break;
					}
				}
				
				Assert.IsTrue(IsServerRegistered, "#A02");
				
				// register the client
				RemotingConfiguration.RegisterWellKnownClientType(typeof(WellKnownObject), "tcp://localhost:1234/"+RemotingConfiguration.ApplicationName+"/WellKnownObject.rem");
				
				// get the registered client
				WellKnownClientTypeEntry[] act = RemotingConfiguration.GetRegisteredWellKnownClientTypes();
				
				bool IsClientRegistered = false;
				foreach(WellKnownClientTypeEntry acte in act)
				{
					if(acte.ObjectType == typeof(WellKnownObject))
					{
						IsClientRegistered = true;
						break;
					}
				}
				
				Assert.IsTrue(IsClientRegistered, "#A03");
				
				WellKnownObject objWellKnown = new WellKnownObject();
				
				
				Assert.IsTrue(objWellKnown != null, "#A04");
				Assert.IsTrue(RemotingServices.IsTransparentProxy(objWellKnown), "#A05");
				objWellKnown.Method1();
				Assert.IsTrue(objWellKnown.Method1Called, "#A06");
			}
			finally
			{
				ChannelServices.UnregisterChannel(chn);
			}
			
		}
 public void RefreshService()
 {
     lstBoxService.Items.Clear();
     foreach (WellKnownServiceTypeEntry w in RemotingConfiguration.GetRegisteredWellKnownServiceTypes())
     {
         lstBoxService.Items.Add(w);
     }
 }
Exemplo n.º 12
0
 public static void MostrarTodosLosDatos()
 {
     Log.Imprimir("TIPOS DE DATOS REGISTRADOS EN REMOTING -(INICIO)- ---------");
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredActivatedClientTypes());
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredActivatedServiceTypes());
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredWellKnownClientTypes());
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredWellKnownServiceTypes());
     Log.Imprimir("TIPOS DE DATOS REGISTRADOS EN REMOTING -(FIN)- ---------");
 }
Exemplo n.º 13
0
        private static int ServerMain(string[] args)
        {
            var configFilename = Path.Combine(Path.GetDirectoryName(typeof(ServerService).Assembly.Location) ?? throw new InvalidOperationException(), "server.config");

            RemotingConfiguration.Configure(configFilename, false);
            var x = ChannelServices.RegisteredChannels;
            var y = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();

            return(0);
        }
Exemplo n.º 14
0
        public static void DumpAllInfoAboutRegisteredRemotingTypes()
        {
            Log.Print("ALL REGISTERED TYPES IN REMOTING -(BEGIN)---------");

            DumpTypeEntries(RemotingConfiguration.GetRegisteredActivatedClientTypes());
            DumpTypeEntries(RemotingConfiguration.GetRegisteredActivatedServiceTypes());
            DumpTypeEntries(RemotingConfiguration.GetRegisteredWellKnownClientTypes());
            DumpTypeEntries(RemotingConfiguration.GetRegisteredWellKnownServiceTypes());

            Log.Print("ALL REGISTERED TYPES IN REMOTING -(END)  ---------");
        }
Exemplo n.º 15
0
 private static void ShowWellKnownServiceTypes()
 {
     WellKnownServiceTypeEntry[] serviceTypeEntries = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
     foreach (WellKnownServiceTypeEntry typeEntry in serviceTypeEntries)
     {
         Console.WriteLine("Assembly: {0}", typeEntry.AssemblyName);
         Console.WriteLine("Mode: {0}", typeEntry.Mode);
         Console.WriteLine("URI: {0}", typeEntry.ObjectUri);
         Console.WriteLine("Type: {0}", typeEntry.TypeName);
     }
 }
Exemplo n.º 16
0
 /// <summary>
 /// 取得远程类信息
 /// </summary>
 /// <returns></returns>
 public static string[] GetRemotingEntries()
 {
     WellKnownServiceTypeEntry[] entries =
         RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
     string[] types = new string[entries.Length];
     for (int index = 0; index < entries.Length; ++index)
     {
         types[index] = entries[index].TypeName;
     }
     return(types);
 }
Exemplo n.º 17
0
 //Metodo de impresion de datos
 public static void MostrarTodosLosDatos()
 {
     Log.Imprimir("TIPOS DE DATOS REGISTRADOS EN REMOTING -(INICIO)- --------");
     //Recupera una matriz de tipos de objetos registrados en el extremo de servicios
     //que puede activarse a petición de un cliente.
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredActivatedClientTypes());
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredActivatedServiceTypes());
     //Recupera una matriz de tipos de objetos registrados en el cliente final como tipos conocidos.
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredWellKnownClientTypes());
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredWellKnownServiceTypes());
     Log.Imprimir("TIPOS DE DATOS REGISTRADOS EN REMOTING -(FIN)- ---------");
 }
Exemplo n.º 18
0
 /// <summary>
 /// Configures remoting
 /// </summary>
 public void Configure()
 {
     try
     {
         // configure
         RemotingConfiguration.Configure("SimulatorClient.exe.config", false);
         wkst = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
     }
     catch (Exception e)
     {
         Console.WriteLine(DateTime.Now.ToString() + ": Error Configuring Remoting: " + e.ToString());
     }
 }
Exemplo n.º 19
0
        private static void printRemoteConfig(System.IO.TextWriter writer)
        {
            foreach (var channel in ChannelServices.RegisteredChannels)
            {
                writer.WriteLine($"Channel {channel.ToString()} registered");
            }
            var services = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();

            foreach (var service in services)
            {
                writer.WriteLine($"Registered {service.TypeName} as {service.Mode} on uri {service.ObjectUri}");
            }
        }
Exemplo n.º 20
0
        private static void instantiateSingletonServer()
        {
            var    type    = RemotingConfiguration.GetRegisteredWellKnownServiceTypes()[0];
            var    channel = ChannelServices.RegisteredChannels[0];
            string uri     = String.Format("{0}://127.0.0.1:{1}/{2}",
                                           ConfigurationManager.AppSettings["Channel"],
                                           ConfigurationManager.AppSettings["Port"], type.ObjectUri);

            instance = (IServerExtended)Activator.GetObject(typeof(IServerExtended), uri);
            instance.SendMessage(String.Format("Singleton Created on port channel {0} and port {1}",
                                               ConfigurationManager.AppSettings["Channel"],
                                               ConfigurationManager.AppSettings["Port"]));
            instance.Start();
        }
Exemplo n.º 21
0
 // Método que recupera la información acerca del tipo de los objetos definidos, configurados
 // para el programa que usa net remoting
 public static void MostrarTodosLosDatos()
 {
     Log.Imprimir("TIPOS DE DATOS REGISTRADOS EN REMOTING -(INICIO)- ---------");
     // Recupera los tipos de objetos registrados en el cliente como tipos que se activarán
     // de forma remota
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredActivatedClientTypes());
     // Recupera los tipos de objetos registrados en el servicio que se pueden activar
     // cuando lo solicita un cliente.
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredActivatedServiceTypes());
     // Recupera los tipos de objetos registrados en el cliente como tipos conocidos (WellKnown)
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredWellKnownClientTypes());
     // Recupera los  tipos de objetos registrados en el servicio como tipos conocidos (WellKnown)
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredWellKnownServiceTypes());
     Log.Imprimir("TIPOS DE DATOS REGISTRADOS EN REMOTING -(FIN)- ---------");
 }
Exemplo n.º 22
0
 /// Metodo MostrarTodosLosDatos
 public static void MostrarTodosLosDatos()
 {
     //Llamada al metodo Imprimir de la clase Log
     Log.Imprimir("TIPOS DE DATOS REGISTRADOS EN REMOTING -(INICIO)- ----------");
     //llamada al metodo MostrarTipoDeDatos que obtiene los tipos de datos de la comunicacion remota
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredActivatedClientTypes());
     //llamada al metodo MostrarTipoDeDatos que obtiene los tipos de datos de la comunicacion remota
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredActivatedServiceTypes());
     //llamada al metodo MostrarTipoDeDatos que obtiene los tipos de datos de la comunicacion remota
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredWellKnownClientTypes());
     //llamada al metodo MostrarTipoDeDatos que obtiene los tipos de datos de la comunicacion remota
     MostrarTipoDeDatos(RemotingConfiguration.GetRegisteredWellKnownServiceTypes());
     //Llamada al metodo Imprimir de la clase Log
     Log.Imprimir("TIPOS DE DATOS REGISTRADOS EN REMOTIN -(FIN)- ----------");
 }
        public static void InitComm()
        {
            // set the machine name from the config
            machineName = Properties.Settings.Default.MachineName.Trim().ToUpper();

            // configure remoting
            RemotingConfiguration.Configure("net.xml", false);

            // get the name service
            WellKnownServiceTypeEntry[] wkst = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
            objectDirectory = (ObjectDirectory)Activator.GetObject(typeof(ObjectDirectory), wkst[0].ObjectUri);

            // get the channel factory
            channelFactory = (IChannelFactory)objectDirectory.Resolve("ChannelFactory");
        }
Exemplo n.º 24
0
        public static bool DoesWellKnowServiceExist(string ServiceName)
        {
            bool RetVal = false;

            WellKnownServiceTypeEntry[] ExistingServices = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
            foreach (WellKnownServiceTypeEntry Service in ExistingServices)
            {
                if (Service.ObjectUri == ServiceName)
                {
                    RetVal = true;
                    break;
                }
            }

            return(RetVal);
        }
        public static void ConfigureRemoting(string server)
        {
            RemotingConfiguration.Configure("net.xml", false);

            if (!string.IsNullOrEmpty(server))
            {
                string uri = "tcp://" + server + ":12345/ObjectDirectory";
                od = (ObjectDirectory)Activator.GetObject(typeof(ObjectDirectory), uri);
            }
            else
            {
                WellKnownServiceTypeEntry[] wkst = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
                // "Activate" the NameService singleton.
                od = (ObjectDirectory)Activator.GetObject(typeof(ObjectDirectory), wkst[0].ObjectUri);
            }
        }
        private static bool ExistServiceType(string typeName, ref string url)
        {
            typeName = typeName.Trim();
            WellKnownServiceTypeEntry[] entries = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();

            for (int i = 0; i < entries.Length; i++)
            {
                if (entries[i].TypeName == typeName)
                {
                    url = entries[i].ObjectUri;
                    return(true);
                }
            }

            return(false);                      //Not found
        }
        /// <summary>
        /// Configures remoting
        /// </summary>
        public void Configure()
        {
            try
            {
                // configure
                RemotingConfiguration.Configure("Simulator.exe.config", false);
                wkst = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();

                // notfy
                SimulatorOutput.WriteLine("Remoting Configured Successfully");
            }
            catch (Exception e)
            {
                SimulatorOutput.WriteLine("Error Configuring Remoting: " + e.ToString());
            }
        }
Exemplo n.º 28
0
 public static String GetTypeName(
     String Uri)
 {
     WellKnownServiceTypeEntry[] svcTypes
         = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
     foreach (WellKnownServiceTypeEntry svcType in svcTypes)
     {
         if (Uri.Equals("/" + svcType.ObjectUri))
         {
             // we need to pass type of service to deserializer and Type.GetType
             // requires assembly qualified name
             return(svcType.ObjectType.AssemblyQualifiedName);
         }
     }
     throw new Exception("couldn't find type");
 }
Exemplo n.º 29
0
        static void Main(string[] args)
        {
            // Read the configuration file.
            RemotingConfiguration.Configure("..\\..\\ProxyService.exe.config", false);
            WellKnownServiceTypeEntry[] wkst = RemotingConfiguration.GetRegisteredWellKnownServiceTypes();

            // "Activate" the NameService singleton.
            ObjectDirectory od = (ObjectDirectory)Activator.GetObject(typeof(ObjectDirectory), wkst[0].ObjectUri);

            // Bind the facades of components we implement.
            od.Rebind(Arbiter.FacadeImpl.Instance, "Arbiter");

            Console.WriteLine("Waiting");

            // Enter the main event loop...
            Console.ReadLine();
        }
Exemplo n.º 30
0
        public static void Main(String[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("---------------------------------");
            Console.WriteLine("WARNING ! XEN SERVER UNLEASHED !");
            Console.WriteLine("---------------------------------");

            try {
                TcpChannel channel = new TcpChannel(2019);
                ChannelServices.RegisterChannel(channel, false);

                RemotingConfiguration.RegisterWellKnownServiceType(typeof(ServiceAuthentification), "ServiceAuthentification", WellKnownObjectMode.Singleton);

                RemotingConfiguration.RegisterWellKnownServiceType(typeof(MachineManagerService), "MachineManagerService", WellKnownObjectMode.Singleton);

                RemotingConfiguration.RegisterWellKnownServiceType(typeof(ClientManagerService), "ClientManagerService", WellKnownObjectMode.Singleton);

                RemotingConfiguration.RegisterWellKnownServiceType(typeof(FactureManagerService), "FactureManagerService", WellKnownObjectMode.Singleton);


                Trace.TraceInformation("Started server On " + DateTime.Now.ToString());
                Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
                Trace.AutoFlush = true;


                Console.WriteLine("RegisteredTypes : ");
                foreach (WellKnownServiceTypeEntry obj in RemotingConfiguration.GetRegisteredWellKnownServiceTypes())
                {
                    Console.WriteLine("Object : " + obj.ObjectType);
                }
                Console.WriteLine("---------------------------");
                Console.WriteLine("");

                System.Console.WriteLine("Server Running ...");

                while (true)
                {
                }
            } catch (Exception e) {
                Trace.TraceError("Server crash On : " + DateTime.Now.ToString());
                Trace.WriteLine(e.StackTrace);
                System.Console.WriteLine("Server Runtime Exception ...");
                System.Console.WriteLine(e.Message);
            }
        }