System.Runtime.Remoting.Identity.RaceSetChannelSink C# (CSharp) Method

RaceSetChannelSink() private method

private RaceSetChannelSink ( IMessageSink channelSink ) : IMessageSink
channelSink IMessageSink
return IMessageSink
        internal IMessageSink  RaceSetChannelSink(IMessageSink channelSink)
        {
            if (_channelSink == null)
            {
                Interlocked.CompareExchange(
                                        ref _channelSink,
                                        channelSink,
                                        null);
            }
            return (IMessageSink) _channelSink;
        }

Usage Example

示例#1
0
        } // CreateChannelSinks
 
        internal static void SetEnvoyAndChannelSinks(Identity idObj,
                                                    IMessageSink chnlSink, 
                                                    IMessageSink envoySink) 
        {
            Message.DebugOut("Setting up envoy and channel sinks \n"); 
            BCLDebug.Assert(null != idObj,"null != idObj");

            // Decide if we need to set the envoy sink chain
            if (null == idObj.ChannelSink) 
            {
                if (null != chnlSink) 
                { 
                    idObj.RaceSetChannelSink(chnlSink);
                } 
            }

            // Decide if we need to set the envoy sink chain
            if (null == idObj.EnvoyChain) 
            {
                if (null != envoySink) 
                { 
                    idObj.RaceSetEnvoyChain(envoySink);
                } 
                else
                {
                    throw new RemotingException(
                        String.Format( 
                            CultureInfo.CurrentCulture, Environment.GetResourceString(
                                "Remoting_BadInternalState_FailEnvoySink"))); 
                } 
            }
        } 
All Usage Examples Of System.Runtime.Remoting.Identity::RaceSetChannelSink