Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: Linklabel Pin
Anonymous9-Feb-04 14:41
Anonymous9-Feb-04 14:41 
QuestionHow can I detect when a client disconnects from a well known service? Pin
Marc Clifton9-Feb-04 6:13
mvaMarc Clifton9-Feb-04 6:13 
AnswerRe: How can I detect when a client disconnects from a well known service? Pin
LongRange.Shooter9-Feb-04 8:17
LongRange.Shooter9-Feb-04 8:17 
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
Marc Clifton9-Feb-04 8:21
mvaMarc Clifton9-Feb-04 8:21 
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
LongRange.Shooter9-Feb-04 8:26
LongRange.Shooter9-Feb-04 8:26 
AnswerRe: How can I detect when a client disconnects from a well known service? Pin
Tom Larsen9-Feb-04 10:30
Tom Larsen9-Feb-04 10:30 
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
Marc Clifton9-Feb-04 10:58
mvaMarc Clifton9-Feb-04 10:58 
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
Tom Larsen9-Feb-04 11:37
Tom Larsen9-Feb-04 11:37 
Sorry about the vagueness in the example. I would like to give out the exact nature of the application but I'm not at liberty to give out the fine deatils. Besides its a boring application. Wink | ;-)

In general it behaves like this your standard transactioned setup

LimitedRemoteResource res = null;
try
{
    res = new LimitedRemoteResource();
    res.Allocate();

    this.MethodDoesSomething(res,argsA);
    this.SomeOtherMethodDoesSomething(res,argsB);
    ....
    // somewhere along the way the application goes poof!
    ....
}
finally
{
    // if something really bad happens this doesn't get called anyway
    if(res != null)
        res.Release();
}


If LimitedRemoteResource is a remoted type, there seems little that can be done to to be absolutely sure the finally block is reached and the resource is unallocated. Even if the code all works but the network is disconnected, calling Release won't work because server isn't reachable.

The example I gave was just supposed to highlight a general problem I'm constantly running into in remoted frameworks. A client in the remoting framework requests a resource from a pool from the server but the client ends up disconnecting before the resource is returned. Because its in a disconnected state there is no way for the client to contact the server to tell them of this problem (duh, it wouldn't be in a disconnected state if it could).

On the server side, you can't guarentee when if at all any of the server representation of the objects will be disposed and behaves more like the CLR is just unloaded/killed than it is asked to quit when the web server recycles threads. I've tried implementing crazy watching schemes like mentioned in the link where one thread watches for signs of life from the other but the it behaves on cleanup like th CLR is just unloaded instead of asked to exit/dispose. I get no indications at all that Dispose on any remoted object is being called when the web server does its normal thread cleanup or is forced to (ie. server reset).

So I am stumped. I *think* I need a "CLR Unloading" type event on the server.
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
Marc Clifton9-Feb-04 13:30
mvaMarc Clifton9-Feb-04 13:30 
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
Tom Larsen10-Feb-04 7:04
Tom Larsen10-Feb-04 7:04 
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
LongRange.Shooter10-Feb-04 9:08
LongRange.Shooter10-Feb-04 9:08 
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
Tom Larsen11-Feb-04 3:53
Tom Larsen11-Feb-04 3:53 
GeneralRe: How can I detect when a client disconnects from a well known service? Pin
HAHAHA_NEXT9-Feb-04 11:01
HAHAHA_NEXT9-Feb-04 11:01 
QuestionHow to get/set printer paper media type Pin
trythat9-Feb-04 5:55
trythat9-Feb-04 5:55 
QuestionDynamic attributes for propertyGrid??? Pin
LongRange.Shooter9-Feb-04 3:11
LongRange.Shooter9-Feb-04 3:11 
AnswerRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart9-Feb-04 4:17
protectorHeath Stewart9-Feb-04 4:17 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter9-Feb-04 8:09
LongRange.Shooter9-Feb-04 8:09 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart9-Feb-04 9:33
protectorHeath Stewart9-Feb-04 9:33 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter9-Feb-04 10:38
LongRange.Shooter9-Feb-04 10:38 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart9-Feb-04 14:02
protectorHeath Stewart9-Feb-04 14:02 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter10-Feb-04 8:58
LongRange.Shooter10-Feb-04 8:58 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart10-Feb-04 11:18
protectorHeath Stewart10-Feb-04 11:18 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter11-Feb-04 7:49
LongRange.Shooter11-Feb-04 7:49 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart11-Feb-04 9:14
protectorHeath Stewart11-Feb-04 9:14 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter11-Feb-04 10:45
LongRange.Shooter11-Feb-04 10:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.