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);
        }
Пример #2
0
        internal void Unregister(bool release)
        {
            PeerNodeImplementation node = this.peerNode;

            if (node != null)
            {
                if (registered)
                {
                    node.UnregisterMessageFilter(this, via);
                    registered = false;
                }
                if (release)
                {
                    node.Release();
                }
            }
        }