[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Exception catching low level

Robin Prosch via .NET 247

8/4/2004 11:46:00 AM

Hi,

I'm currently developping an application based on Remoting. I hava a client app and a server app, along with an extra application which monitors the server. This application has the possibility to log out other users which are currently logged on on the server with the client app. When a client invokes a method at the server, the server checks whether the client is still logged in or logged out. If the client is logged out, it receives an InvalidUserException, which I defined myself. Every time I invoke a method on the server with a client app I have to do a try { } catch { } to check if the user is still logged in. Is it possible to do the try / catch at a lower level using the remoting technique (in the sink maybe?) ? Every time a user gets kicked off the server the same action must occur in the client, so it's kinda overkill to do a try catch every time the client invokes a method on the server. What I want is a try { } catch(InvalidUserException e) { // go to logout form }, but only defined once in my client app. Anyone a suggestion? Thanx in advance...

-----------------------
Posted by a user from .NET 247 (http://www.dotn...)

<Id>ENcZlOGoLkiaJGCOgz3Sbg==</Id>
1 Answer

Sunny

8/4/2004 3:33:00 PM

0

Hi,

In article <uu7yniheEHA.3148@TK2MSFTNGP10.phx.gbl>,
anonymous@dotnet247.com says...
> Hi,
>
> I'm currently developping an application based on Remoting. I hava a client app and a server app, along with an extra application which monitors the server. This application has the possibility to log out other users which are currently logged on on the server with the client app. When a client invokes a method at the server, the server checks whether the client is still logged in or logged out. If the client is logged out, it receives an InvalidUserException, which I
defined myself. Every time I invoke a method on the server with a client app I have to do a try { } catch { } to check if the user is still logged in. Is it possible to do the try / catch at a lower level using the remoting technique (in the sink maybe?) ? Every time a user gets kicked off the server the same action must occur in the client, so it's kinda overkill to do a try catch every time the client invokes a method on the server. What I want is a try { } catch
(InvalidUserException e) { // go to logout form }, but only defined once in my client app. Anyone a suggestion? Thanx in advance...
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotn...)
>
> <Id>ENcZlOGoLkiaJGCOgz3Sbg==</Id>
>

What you can do is to put all your server invocations in one big
try/catch block.

Or you can create some invoking methods, to which you pass a delegate to
the server methods, and you will have the try/catch only there.

OR :), like the previous one, but as you suggested, inserted in a custom
sync.

Sunny