Exemplo n.º 1
0
        public void StartService(string url)
        {
            string[] splits = url.Split(':');
            splits = splits[splits.Length - 1].Split('/');
            int channelPort = int.Parse(splits[0]);

            try {
                this.port = channelPort;

                remoteObject = new PM();
                TcpChannel myChannel = new TcpChannel(this.port);
                ChannelServices.RegisterChannel(myChannel, true);
                RemotingServices.Marshal(remoteObject, SERVICE_NAME, typeof(IPuppetMaster));

                serviceUrl = "tcp://*****:*****@ " + serviceUrl);
            }
            catch (Exception ex)
            {
                Logger.LogErr("Couldn't start service: " + ex.Message);
            }
        }