I didn't respond to this earlier because I hadn't received any word from
Microsoft yet, but I have been experiencing the same issue, only from the
client-side of seeing the error. We use the CallContext to store some
ILogicalThreadAffinative objects, and when the remoting infrastructure
throws an exception (say when a SocketException occurs because it can't find
a URI), the CallContext isn't restored on the side of the client.

I just finally got word back from premier support that this is "by design",
so your #1 assumption is correct.

Adam..

> -----Original Message-----
> From: Moderated discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Klaus Lindemann
> Sent: Monday, December 08, 2003 4:08 AM
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Throwing exception in server side sink destroys
> CallContext on client
>
> Hi
>
> I have implemented a server-side sink for checking various things on
> incoming calls on the server. At the same time I am using the CallContext
> class to pass information from the client to the server.
>
> This works fine.
>
> However if I in the server-side sink throw an exception, the call context
> on the client is destroyed, which is quite annoying.
>
> I have a guess on why this behaviour is occuring:
>
> In a ProcessMessage method in a sink:
>
> public System.Runtime.Remoting.Channels.ServerProcessing ProcessMessage
> (IServerChannelSinkStack sinkStack,
> System.Runtime.Remoting.Messaging.IMessage requestMsg, ITransportHeaders
> requestHeaders, System.IO.Stream requestStream, out
> System.Runtime.Remoting.Messaging.IMessage responseMsg, out
> ITransportHeaders responseHeaders, out System.IO.Stream responseStream)
>
> the call context is located in the Properties of the requestMsg, and I
> would guess that the same is true for the response. This probably means
> that throwing the exception in the ProcessMessage method returns a null
> for the responseMsg, causing the destruction of the CallContext on the
> client.
>
> So my questions are:
>
> 1) Does anybody know whether my assumption is correct?
>
> 2) Can anyone provide pointers on implementing such a custom response,
> from inside a sink?
>
> I can of course provide further information if needed.

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to