Click here to Skip to main content
15,894,955 members
Home / Discussions / C#
   

C#

 
GeneralConvert int to byte[4] Pin
Anonymous9-Feb-04 14:04
Anonymous9-Feb-04 14:04 
GeneralRe: Convert int to byte[4] Pin
John Kuhn9-Feb-04 16:11
John Kuhn9-Feb-04 16:11 
GeneralRe: Convert int to byte[4] Pin
HAHAHA_NEXT10-Feb-04 4:01
HAHAHA_NEXT10-Feb-04 4:01 
QuestionWhat hook? Pin
Anonymous9-Feb-04 13:51
Anonymous9-Feb-04 13:51 
AnswerRe: What hook? Pin
Mazdak9-Feb-04 19:42
Mazdak9-Feb-04 19:42 
GeneralRelative file paths Pin
dratti9-Feb-04 13:02
dratti9-Feb-04 13:02 
GeneralFunctions and pointers Pin
Kryal9-Feb-04 11:54
Kryal9-Feb-04 11:54 
GeneralRe: Functions and pointers Pin
Marc Clifton9-Feb-04 13:47
mvaMarc Clifton9-Feb-04 13:47 
GeneralBroadcast VS Multicast Pin
HAHAHA_NEXT9-Feb-04 11:07
HAHAHA_NEXT9-Feb-04 11:07 
GeneralRedirected StandardOutput and StandardError hanging Pin
Anonymous9-Feb-04 10:18
Anonymous9-Feb-04 10:18 
GeneralStarting a process on a remote machine with WMI Pin
Paul L C9-Feb-04 9:48
Paul L C9-Feb-04 9:48 
GeneralRe: Starting a process on a remote machine with WMI Pin
scadaguy9-Feb-04 10:49
scadaguy9-Feb-04 10:49 
GeneralLinklabel Pin
c5328699-Feb-04 7:47
c5328699-Feb-04 7:47 
GeneralRe: Linklabel Pin
Mike Ellison9-Feb-04 8:19
Mike Ellison9-Feb-04 8:19 
GeneralRe: Linklabel Pin
Charlie Williams9-Feb-04 9:08
Charlie Williams9-Feb-04 9:08 
GeneralRe: Linklabel Pin
Charlie Williams9-Feb-04 9:03
Charlie Williams9-Feb-04 9:03 
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 

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.