internal static void NotifyProfiler(IMessage msg, RemotingProfilerEvent profilerEvent) { if (profilerEvent != RemotingProfilerEvent.ClientSend) { if (profilerEvent != RemotingProfilerEvent.ClientReceive || !RemotingServices.CORProfilerTrackRemoting()) { return; } Guid id = Guid.Empty; if (RemotingServices.CORProfilerTrackRemotingCookie()) { object obj = msg.Properties[(object)"CORProfilerCookie"]; if (obj != null) { id = (Guid)obj; } } RemotingServices.CORProfilerRemotingClientReceivingReply(id, false); } else { if (!RemotingServices.CORProfilerTrackRemoting()) { return; } Guid id; RemotingServices.CORProfilerRemotingClientSendingMessage(out id, false); if (!RemotingServices.CORProfilerTrackRemotingCookie()) { return; } msg.Properties[(object)"CORProfilerCookie"] = (object)id; } }
[System.Security.SecurityCritical] // auto-generated public virtual IMessage SyncProcessMessage(IMessage replyMsg) { // If this class has been brought into the picture, then the following must be true. BCLDebug.Assert(RemotingServices.CORProfilerTrackRemoting(), "CORProfilerTrackRemoting returned false, but we're in AsyncProcessMessage!"); BCLDebug.Assert(RemotingServices.CORProfilerTrackRemotingAsync(), "CORProfilerTrackRemoting returned false, but we're in AsyncProcessMessage!"); Guid g = Guid.Empty; // If GUID cookies are active, then we try to get it from the properties dictionary if (RemotingServices.CORProfilerTrackRemotingCookie()) { Object obj = replyMsg.Properties["CORProfilerCookie"]; if (obj != null) { g = (Guid)obj; } } // Notify the profiler that we are receiving an async reply from the server-side RemotingServices.CORProfilerRemotingClientReceivingReply(g, true); // Now that we've done the intercepting, pass the message on to the regular chain return(_nextSink.SyncProcessMessage(replyMsg)); }
public virtual IMessage SyncProcessMessage(IMessage replyMsg) { Guid id = Guid.Empty; if (RemotingServices.CORProfilerTrackRemotingCookie()) { object obj = replyMsg.Properties["CORProfilerCookie"]; if (obj != null) { id = (Guid)obj; } } RemotingServices.CORProfilerRemotingClientReceivingReply(id, true); return(this._nextSink.SyncProcessMessage(replyMsg)); }
// // INTERNAL PROFILER NOTIFICATION SERVICES // internal static void NotifyProfiler(IMessage msg, RemotingProfilerEvent profilerEvent) { switch (profilerEvent) { case RemotingProfilerEvent.ClientSend: { if (RemotingServices.CORProfilerTrackRemoting()) { Guid g; RemotingServices.CORProfilerRemotingClientSendingMessage(out g, false); if (RemotingServices.CORProfilerTrackRemotingCookie()) { msg.Properties["CORProfilerCookie"] = g; } } break; } // case RemotingProfilerEvent.ClientSend case RemotingProfilerEvent.ClientReceive: { if (RemotingServices.CORProfilerTrackRemoting()) { Guid g = Guid.Empty; if (RemotingServices.CORProfilerTrackRemotingCookie()) { Object obj = msg.Properties["CORProfilerCookie"]; if (obj != null) { g = (Guid)obj; } } RemotingServices.CORProfilerRemotingClientReceivingReply(g, false); } break; } // case RemotingProfilerEvent.ClientReceive } // switch (event) } // NotifyProfiler
internal static void NotifyProfiler(IMessage msg, RemotingProfilerEvent profilerEvent) { switch (profilerEvent) { case RemotingProfilerEvent.ClientSend: Guid guid; if (!RemotingServices.CORProfilerTrackRemoting()) { break; } RemotingServices.CORProfilerRemotingClientSendingMessage(out guid, false); if (!RemotingServices.CORProfilerTrackRemotingCookie()) { break; } msg.Properties["CORProfilerCookie"] = guid; return; case RemotingProfilerEvent.ClientReceive: if (RemotingServices.CORProfilerTrackRemoting()) { Guid empty = Guid.Empty; if (RemotingServices.CORProfilerTrackRemotingCookie()) { object obj2 = msg.Properties["CORProfilerCookie"]; if (obj2 != null) { empty = (Guid)obj2; } } RemotingServices.CORProfilerRemotingClientReceivingReply(empty, false); } break; default: return; } }