[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)); }
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; } }
internal static object SyncProcessMessageCallback(object[] args) { IMessage msg = args[0] as IMessage; Context context = args[1] as Context; IMessage message2 = null; if (RemotingServices.CORProfilerTrackRemoting()) { Guid empty = Guid.Empty; if (RemotingServices.CORProfilerTrackRemotingCookie()) { object obj2 = msg.Properties["CORProfilerCookie"]; if (obj2 != null) { empty = (Guid)obj2; } } RemotingServices.CORProfilerRemotingServerReceivingMessage(empty, false); } context.NotifyDynamicSinks(msg, false, true, false, true); message2 = context.GetServerContextChain().SyncProcessMessage(msg); context.NotifyDynamicSinks(message2, false, false, false, true); if (RemotingServices.CORProfilerTrackRemoting()) { Guid guid2; RemotingServices.CORProfilerRemotingServerSendingReply(out guid2, false); if (RemotingServices.CORProfilerTrackRemotingCookie()) { message2.Properties["CORProfilerCookie"] = guid2; } } return(message2); }
internal static object SyncProcessMessageCallback(object[] args) { IMessage msg1 = args[0] as IMessage; Context context = args[1] as Context; if (RemotingServices.CORProfilerTrackRemoting()) { Guid id = Guid.Empty; if (RemotingServices.CORProfilerTrackRemotingCookie()) { object obj = msg1.Properties[(object)"CORProfilerCookie"]; if (obj != null) { id = (Guid)obj; } } RemotingServices.CORProfilerRemotingServerReceivingMessage(id, false); } IMessage msg2 = msg1; int num1 = 0; int num2 = 1; int num3 = 0; int num4 = 1; context.NotifyDynamicSinks(msg2, num1 != 0, num2 != 0, num3 != 0, num4 != 0); IMessage message = context.GetServerContextChain().SyncProcessMessage(msg1); IMessage msg3 = message; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 1; context.NotifyDynamicSinks(msg3, num5 != 0, num6 != 0, num7 != 0, num8 != 0); if (RemotingServices.CORProfilerTrackRemoting()) { Guid id; RemotingServices.CORProfilerRemotingServerSendingReply(out id, false); if (RemotingServices.CORProfilerTrackRemotingCookie()) { message.Properties[(object)"CORProfilerCookie"] = (object)id; } } return((object)message); }
// // 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
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; // Notify the profiler that we are receiving an async reply from the server-side RemotingServices.CORProfilerRemotingServerSendingReply(out g, true); // If GUID cookies are active, then we save it for the other end of the channel if (RemotingServices.CORProfilerTrackRemotingCookie()) { replyMsg.Properties["CORProfilerCookie"] = g; } // Now that we've done the intercepting, pass the message on to the regular chain return(_nextSink.SyncProcessMessage(replyMsg)); }
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; } }
[System.Security.SecurityCritical] // auto-generated internal static Object SyncProcessMessageCallback(Object[] args) { IMessage reqMsg = args[0] as IMessage; Context srvCtx = args[1] as Context; IMessage replyMsg = null; // If profiling of remoting is active, must tell the profiler that we have received // a message. if (RemotingServices.CORProfilerTrackRemoting()) { Guid g = Guid.Empty; if (RemotingServices.CORProfilerTrackRemotingCookie()) { Object obj = reqMsg.Properties["CORProfilerCookie"]; if (obj != null) { g = (Guid)obj; } } RemotingServices.CORProfilerRemotingServerReceivingMessage(g, false); } Message.DebugOut("::::::::::::::::::::::::: CrossContext Channel: passing to ServerContextChain"); // Server side notifications for dynamic sinks are done // in the x-context channel ... this is to maintain // symmetry of the point of notification between // the client and server context srvCtx.NotifyDynamicSinks( reqMsg, false, // bCliSide true, // bStart false, // bAsync true); // bNotifyGlobals replyMsg = srvCtx.GetServerContextChain().SyncProcessMessage(reqMsg); srvCtx.NotifyDynamicSinks( replyMsg, false, // bCliSide false, // bStart false, // bAsync true); // bNotifyGlobals Message.DebugOut("::::::::::::::::::::::::: CrossContext Channel: back from ServerContextChain"); // If profiling of remoting is active, must tell the profiler that we are sending a // reply message. if (RemotingServices.CORProfilerTrackRemoting()) { Guid g; RemotingServices.CORProfilerRemotingServerSendingReply(out g, false); if (RemotingServices.CORProfilerTrackRemotingCookie()) { replyMsg.Properties["CORProfilerCookie"] = g; } } return(replyMsg); }
public virtual IMessage SyncProcessMessage(IMessage reqMsg) { IMessage replyMsg = null; try { Message.DebugOut("\n::::::::::::::::::::::::: CrossContext Channel: Sync call starting"); IMessage errMsg = ValidateMessage(reqMsg); if (errMsg != null) { return(errMsg); } ServerIdentity srvID = GetServerIdentity(reqMsg); Message.DebugOut("Got Server identity \n"); BCLDebug.Assert(null != srvID, "null != srvID"); BCLDebug.Assert(null != srvID.ServerContext, "null != srvID.ServerContext"); bool fEnteredContext = false; ContextTransitionFrame frame = new ContextTransitionFrame(); try { Context srvCtx = srvID.ServerContext; Thread.CurrentThread.EnterContext(srvCtx, ref frame); fEnteredContext = true; // If profiling of remoting is active, must tell the profiler that we have received // a message. if (RemotingServices.CORProfilerTrackRemoting()) { Guid g = Guid.Empty; if (RemotingServices.CORProfilerTrackRemotingCookie()) { Object obj = reqMsg.Properties["CORProfilerCookie"]; if (obj != null) { g = (Guid)obj; } } RemotingServices.CORProfilerRemotingServerReceivingMessage(g, false); } Message.DebugOut("::::::::::::::::::::::::: CrossContext Channel: passing to ServerContextChain"); // Server side notifications for dynamic sinks are done // in the x-context channel ... this is to maintain // symmetry of the point of notification between // the client and server context srvCtx.NotifyDynamicSinks( reqMsg, false, // bCliSide true, // bStart false, // bAsync true); // bNotifyGlobals replyMsg = srvCtx.GetServerContextChain().SyncProcessMessage(reqMsg); srvCtx.NotifyDynamicSinks( replyMsg, false, // bCliSide false, // bStart false, // bAsync true); // bNotifyGlobals Message.DebugOut("::::::::::::::::::::::::: CrossContext Channel: back from ServerContextChain"); // If profiling of remoting is active, must tell the profiler that we are sending a // reply message. if (RemotingServices.CORProfilerTrackRemoting()) { Guid g; RemotingServices.CORProfilerRemotingServerSendingReply(out g, false); if (RemotingServices.CORProfilerTrackRemotingCookie()) { replyMsg.Properties["CORProfilerCookie"] = g; } } } finally { if (fEnteredContext) { Thread.CurrentThread.ReturnToContext(ref frame); } } } catch (Exception e) { Message.DebugOut("Arrgh.. XCTXSink::throwing exception " + e + "\n"); replyMsg = new ReturnMessage(e, (IMethodCallMessage)reqMsg); if (reqMsg != null) { ((ReturnMessage)replyMsg).SetLogicalCallContext( (LogicalCallContext) reqMsg.Properties[Message.CallContextKey]); } } Message.DebugOut("::::::::::::::::::::::::::: CrossContext Channel: Sync call returning!!\n"); return(replyMsg); }