internal bool IsNestedCall(IMessage reqMsg)
{
// This returns TRUE only if it is a non-reEntrant context
// AND
// (the LCID of the reqMsg matches that of
// the top level sync call lcid associated with the context.
// OR
// it matches one of the async call out lcids)
bool bNested = false;
if (!IsReEntrant)
{
String lcid = SyncCallOutLCID;
if (lcid != null)
{
// This means we are inside a top level call
LogicalCallContext callCtx =
(LogicalCallContext)reqMsg.Properties[Message.CallContextKey];
if ( callCtx!=null &&
lcid.Equals(callCtx.RemotingData.LogicalCallID))
{
// This is a nested call (we made a call out during
// the top level call and eventually that has resulted
// in an incoming call with the same lcid)
bNested = true;
}
}
if (!bNested && AsyncCallOutLCIDList.Count>0)
{
// This means we are inside a top level call
LogicalCallContext callCtx =
(LogicalCallContext)reqMsg.Properties[Message.CallContextKey];
if (AsyncCallOutLCIDList.Contains(callCtx.RemotingData.LogicalCallID))
{
bNested = true;
}
}
}
return bNested;
}