Exemple #1
0
        public void Start()
        {
            NTrace.Info("Starting");
            this.channel = ServerUtilities.GetTcpChannel();
            NTrace.Debug("Acquired Tcp Channel");

            try
            {
                this.agency = (TestAgency)Activator.GetObject(typeof(TestAgency), agencyUrl);
                NTrace.DebugFormat("Connected to TestAgency at {0}", agencyUrl);
            }
            catch (Exception ex)
            {
                NTrace.ErrorFormat("Unable to connect to test agency at {0}", agencyUrl);
                NTrace.Error(ex.Message);
            }

            try
            {
                this.agency.Register(this, ProcessId);
                NTrace.Debug("Registered with TestAgency");
            }
            catch (Exception ex)
            {
                NTrace.Error("Failed to register with TestAgency", ex);
            }
        }
Exemple #2
0
        public virtual void Start()
        {
            if (uri != null && uri != string.Empty)
            {
                lock ( theLock )
                {
                    this.channel = ServerUtilities.GetTcpChannel(uri + "Channel", port, 100);

                    RemotingServices.Marshal(this, uri);
                    this.isMarshalled = true;
                }
            }
        }
Exemple #3
0
        public virtual void Start()
        {
            if (uri != null && uri != string.Empty)
            {
                lock (theLock)
                {
                    this.channel = ServerUtilities.GetTcpChannel(uri + "Channel", port, 100);

                    RemotingServices.Marshal(this, uri);
                    this.isMarshalled = true;
                }

                if (this.port == 0)
                {
                    ChannelDataStore store = this.channel.ChannelData as ChannelDataStore;
                    if (store != null)
                    {
                        string channelUri = store.ChannelUris[0];
                        this.port = int.Parse(channelUri.Substring(channelUri.LastIndexOf(':') + 1));
                    }
                }
            }
        }