} // 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")));
}
}
}