Jerry <firstname.lastname@example.org> wrote in message news:email@example.com…
“Xiaodan Tang” <> firstname.lastname@example.org> > wrote in message
news:b0ib13$ec9$> email@example.com> …
Jerry <> firstname.lastname@example.org> > wrote in message
news:b0i594$g16$> email@example.com> …
The document about the flag _NTO_CHF_COID_DISCONNECT is
not very clear. When I turned to Robert Krten’s book, the description
about this flag also made me confused.
Who could explain this flag in an easy-to-understand way, an example
would be very useful.
Assume process A calls ChannelCreate() with this flag set, process B
this channel by calling ConnectAttach().
What is the difference between two cases (with and without this flag)?
When B calles ConnectAttach(), it got back a “connection id”. Actually,
a “server side connection id” (scoid) also created in Process A to
the same connection.
Without the flag, if B ConnectDetach(coid), or crashed, or being killed
by some sort of signal, A will never know, and have the scoid opened.
With the flag, anytime B gone, A got nitified (with a pulse, and scoid
pulse), A could then call ConnectDetach(scoid) to free the scoid.
I thought the flag _NTO_CHF_DISCONNECT does what you said.
then what is difference between _NTO_CHF_DISCONNECT and
Oops. Sorry for that. the _NTO_CHF_COID_DISCONNECT is the
otherway arround. Let’s try it again.
A ChannelCreate() and B ConnectAttach() to it, what happens if A
crashed, or it simply called ChannelDestroy() ? B wouldn’t get informed.
(B could call MsgSend() and try to hit a ESRCH or EBADF, but
that’s not for sure.)
What B would do is, it will ChannelCreate(_NTO_CHF_COID_DISCONNECT)
(note only one channel in a process allowed to set this flag). B will then
have a thread MsgReceive() on the channel to get the notification
that A is died…
Does this make sense now ?