Example #1
0
        private void InitializeForUnmarshal(WhereaboutsReader whereabouts)
        {
            ProtocolInformationReader protocolInformation = whereabouts.ProtocolInformation;

            if ((protocolInformation != null) && protocolInformation.NetworkInboundAccess)
            {
                string str;
                this.inboundEnabled = true;
                bool   flag   = string.Compare(Environment.MachineName, protocolInformation.NodeName, StringComparison.OrdinalIgnoreCase) == 0;
                string suffix = BindingStrings.ActivationCoordinatorSuffix(ProtocolVersion.Version10);
                string str3   = BindingStrings.ActivationCoordinatorSuffix(ProtocolVersion.Version11);
                if (protocolInformation.IsClustered || (protocolInformation.NetworkClientAccess && !flag))
                {
                    if (protocolInformation.IsClustered)
                    {
                        str = null;
                    }
                    else
                    {
                        str = "host/" + protocolInformation.HostName;
                    }
                    if (protocolInformation.IsV10Enabled)
                    {
                        this.remoteActivationService10 = this.CreateActivationEndpointAddress(protocolInformation, suffix, str, true);
                    }
                    if (protocolInformation.IsV11Enabled)
                    {
                        this.remoteActivationService11 = this.CreateActivationEndpointAddress(protocolInformation, str3, str, true);
                    }
                }
                if (flag)
                {
                    str = "host/" + protocolInformation.NodeName;
                    if (protocolInformation.IsV10Enabled)
                    {
                        this.localActivationService10 = this.CreateActivationEndpointAddress(protocolInformation, suffix, str, false);
                    }
                    if (protocolInformation.IsV11Enabled)
                    {
                        this.localActivationService11 = this.CreateActivationEndpointAddress(protocolInformation, str3, str, false);
                    }
                }
            }
        }
Example #2
0
        void InitializeForUnmarshal(WhereaboutsReader whereabouts)
        {
            ProtocolInformationReader protocol = whereabouts.ProtocolInformation;

            if (protocol != null && protocol.NetworkInboundAccess)
            {
                this.inboundEnabled = true;

                bool isTmLocal = string.Compare(Environment.MachineName,
                                                protocol.NodeName,
                                                StringComparison.OrdinalIgnoreCase) == 0;

                string spnIdentity;

                string activationCoordinatorSuffix10 =
                    BindingStrings.ActivationCoordinatorSuffix(ProtocolVersion.Version10);

                string activationCoordinatorSuffix11 =
                    BindingStrings.ActivationCoordinatorSuffix(ProtocolVersion.Version11);

                if (protocol.IsClustered ||
                    (protocol.NetworkClientAccess && !isTmLocal))
                {
                    if (protocol.IsClustered)
                    {
                        // We cannot reliably perform mutual authentication against a clustered resource
                        // See MB 43523 for more details on this

                        spnIdentity = null;
                    }
                    else
                    {
                        spnIdentity = "host/" + protocol.HostName;
                    }

                    if (protocol.IsV10Enabled)
                    {
                        this.remoteActivationService10 = CreateActivationEndpointAddress(protocol,
                                                                                         activationCoordinatorSuffix10,
                                                                                         spnIdentity,
                                                                                         true);
                    }

                    if (protocol.IsV11Enabled)
                    {
                        this.remoteActivationService11 = CreateActivationEndpointAddress(protocol,
                                                                                         activationCoordinatorSuffix11,
                                                                                         spnIdentity,
                                                                                         true);
                    }
                }

                if (isTmLocal)
                {
                    spnIdentity = "host/" + protocol.NodeName;

                    // The net.pipe Activation endpoint uses the host name as a discriminant
                    // for cluster scenarios with more than one service on a node.
                    if (protocol.IsV10Enabled)
                    {
                        this.localActivationService10 = CreateActivationEndpointAddress(protocol,
                                                                                        activationCoordinatorSuffix10,
                                                                                        spnIdentity,
                                                                                        false);
                    }

                    if (protocol.IsV11Enabled)
                    {
                        this.localActivationService11 = CreateActivationEndpointAddress(protocol,
                                                                                        activationCoordinatorSuffix11,
                                                                                        spnIdentity,
                                                                                        false);
                    }
                }
            }
        }