Ejemplo n.º 1
0
        public void AttemptConnection(bool showWarning)
        {
            if (OutInterface != null)
            {
                return;
            }
            ConnectionFailed = false;

            try
            {
                var url = "http://localhost:" + _port + "/" + RemotingServer.GetName(typeof(TOutgoing)) + ".rem";
                OutInterface = (TOutgoing)Activator.GetObject(typeof(TOutgoing), url);
            }
            catch (Exception e)
            {
                if (showWarning)
                {
                    OnConnectionFail(e);
                }
            }
        }
Ejemplo n.º 2
0
        public void AttemptConnection(bool showWarning)
        {
            ConnectionFailed = false;

            if (OutInterface == null)
            {
                try
                {
                    //Register Outgoing
                    OutInterface =
                        (TOutgoing)Activator.GetObject(typeof(TOutgoing),
                                                       "http://localhost:" + _mPort + "/" + RemotingServer.GetName(typeof(TOutgoing)) + ".rem");

                    //Register Incoming channel
                    var channel = new HttpChannel(0);
                    ChannelServices.RegisterChannel(channel, false);
                }
                catch (Exception e)
                {
                    if (showWarning)
                    {
                        OnConnectionFail(e);
                    }
                }
            }
        }