Hi Gunter,
Since your using IPCChannel, Sockets don't even enter into the problem so if your server catches a RemotingException and the client
had failed to notify the server before disconnecting it would be safe to assume that the process was stopped, is deadlocked or was
coded incorrectly. Your client could write to the event log to help you determine any failures, but it should be thoroughly tested
to alleviate the latter two possibilities, in which case you'd be left with the reason for the RemotingException being that the
client process was stopped.
The real question is, why do you care how the connection was lost?
When using other Channels, if your client notifies your server before disconnecting and you catch a RemotingException at some point
in server code, then it's safe to assume that there is either a connectivity issue or a problem with the client process. Local
network failure can now be detected using the System.Net.NetworkChange.NetworkAvailabilityChanged event, at least to some extent.
It might not be the most elegant solution, i.e. catching an Exception, but it alleviates the need for code to monitor the health of
the underlying socket connection, which does not provide an event model for connectivity notifications. You could always write this
functionality yourself or as another respondent has mentioned buy a third party framework that does this for you.
--
Dave Sexton
[quoted text, click to view] "Günter Prossliner" <g.prossliner/gmx/at> wrote in message news:ed7I%232ttGHA.1224@TK2MSFTNGP03.phx.gbl...
> Hello Dave!
>
>> 1. Check the InnerException for more information.
>
> There is none.
>
>> 2. Ensure that the client notifies the server before disconnecting,
>> then regard any RemotingExceptions as an indication of a problem on
>> the client or connectivity issue and handle accordingly.
>
> This is something I already do. But what in cases when it is not possible like:
>
>>> I want to know when a
>>> client has been "hard" disconnected (e.g. Process has been killed).
>
>> 3. Use Sockets instead if you need more control.
>
> This is not an option. I cannot replace an Framework like Remoting by an own Protocoll just for that minor thing.
>
> When I worte the original posting, I do not realy expect an solution because there is no "ErrorCode" Property and no
> InnerException (and no derived RemotingExceptionClasses witch you may catch). The reason for my posting is to ask what other
> developers think about the absense of detailed Error Information.
>
> In my opinion the Remoting team has just fogotten it. Maybe the internal project schedule has not allowed to implement proper
> Error Reporting. I do not see any technical reasons why there is no Property like "ErrorCode". So I am looking forward the next
> .Net Framework Version.
>
>
> br GP
>