I’m not sure if I’m missing something obvious here but I want to be able to detect who detached from my resource manager.
In my manager, I spawn a thread for each connection. When one closes, I’d like to remove the thread that was assigned to that connection. The reason I care is that I do some statistics gathering so I can’t just re-assign the thread to the next connection, I need to reset all the stats on it so I need to know when someone disconnects, which thread they were assigned.
The problem is that I don’t seem to get the information I need when a process detaches to figure this out. Looking in MsgReceive() I see I can get pulses for DISCONNECT, THREADDEATH and COIDDEATH. I currently handle all these and I get them when processes/threads disconnect (or die). But most of these don’t give any information that would let me determine who the other side was.
DISCONNECT - Gives nothing. I looked at the scoid value and it’s a number I don’t recognize as a thread id or process id or connection
THREADDEATH - Gives a thread id. So I can handle this one by having my remote sides pass in their thread id.
COIDDEATH - The value here seems to be the scoid value in DISCONNECT
So is there a way to associate the scoid value with a thread/process? I tried looking at the IO_CONNECT message and what it passes in but it does not seem to give the scoid value (unless I missed it someplace)