Exemple #1
0
        public SimpleClient()
        {
            info = new ClientInfo(Guid.NewGuid(), "HES Simple Client", System.Net.Dns.GetHostName(), ((uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds));

            string location = "tcp://localhost:4821/ProxyClientService";

            TcpChannel channel = new TcpChannel();
            ChannelServices.RegisterChannel(channel, true);

            proxy = (IProxyClient)Activator.GetObject(typeof(IProxyClient), location);

            try
            {
                while (!proxy.anyServerAvailable())
                {
                    Console.WriteLine("Try to get IService instance");
                    Thread.Sleep(1000);
                }
                IHes = proxy.getServiceHost<IHes>(info);
                Console.WriteLine("Got it!");

                Console.WriteLine("Ladida");

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.Source);
                Console.WriteLine(ex.StackTrace);
            }

            startSzenario();
        }