internal override IList <TransportManager> SelectTransportManagers()
        {
            //test override
            if (peerNode == null)
            {
                PeerNodeImplementation foundPeerNode = null;

                // use the private InnerNode if it has been configured and matches the channel
                if (privatePeerNode != null && this.Uri.Host == privatePeerNode.MeshId)
                {
                    foundPeerNode     = privatePeerNode;
                    this.registration = null;
                }
                else
                {
                    // find or create a InnerNode for the given Uri
                    this.registration = new PeerNodeImplementation.Registration(this.Uri, this);
                    foundPeerNode     = PeerNodeImplementation.Get(this.Uri, registration);
                }

                // ensure that the max message size is compatible
                if (foundPeerNode.MaxReceivedMessageSize < MaxReceivedMessageSize)
                {
                    foundPeerNode.Release();
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
                              new InvalidOperationException(SR.GetString(SR.PeerMaxReceivedMessageSizeConflict, MaxReceivedMessageSize, foundPeerNode.MaxReceivedMessageSize, this.Uri)));
                }

                // associate with the PeerNode and open it
                peerNode = new PeerNode(foundPeerNode);
            }

            return(null);
        }
Beispiel #2
0
 public PeerInputChannel(PeerNodeImplementation peerNode, PeerNodeImplementation.Registration registration, ChannelManagerBase channelManager, EndpointAddress localAddress, Uri via) : base(channelManager, localAddress)
 {
     PeerNodeImplementation.ValidateVia(via);
     if (registration != null)
     {
         peerNode = PeerNodeImplementation.Get(via, registration);
     }
     this.peerNode = new PeerNode(peerNode);
     this.to       = localAddress;
     this.via      = via;
 }
Beispiel #3
0
 public PeerOutputChannel(PeerNodeImplementation peerNode, PeerNodeImplementation.Registration registration, ChannelManagerBase channelManager, EndpointAddress localAddress, Uri via, MessageVersion messageVersion) : base(channelManager, localAddress, via, false, messageVersion)
 {
     PeerNodeImplementation.ValidateVia(via);
     if (registration != null)
     {
         peerNode = PeerNodeImplementation.Get(via, registration);
     }
     this.peerNode       = new PeerNode(peerNode);
     this.via            = via;
     this.channelManager = channelManager;
     this.to             = localAddress;
 }
 internal override IList <TransportManager> SelectTransportManagers()
 {
     if (this.peerNode == null)
     {
         PeerNodeImplementation peerNode = null;
         if ((this.privatePeerNode != null) && (this.Uri.Host == this.privatePeerNode.MeshId))
         {
             peerNode          = this.privatePeerNode;
             this.registration = null;
         }
         else
         {
             this.registration = new System.ServiceModel.Channels.PeerNodeImplementation.Registration(this.Uri, this);
             peerNode          = PeerNodeImplementation.Get(this.Uri, this.registration);
         }
         if (peerNode.MaxReceivedMessageSize < this.MaxReceivedMessageSize)
         {
             peerNode.Release();
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("PeerMaxReceivedMessageSizeConflict", new object[] { this.MaxReceivedMessageSize, peerNode.MaxReceivedMessageSize, this.Uri })));
         }
         this.peerNode = new PeerNode(peerNode);
     }
     return(null);
 }