Closing connections to resource managers when client dies

If I control-C my client app that has a open connection to my resource
manager, how do I design the resource manager to recognize this situation
and close the channel?

Chris Rose <esorcc@hotmail.com> wrote:

If I control-C my client app that has a open connection to my resource
manager, how do I design the resource manager to recognize this situation
and close the channel?

You need to handle the unblock() connection function. When the client
dies your resmgr will get a callback telling you to unblock and cleanup.
I belive this is the default behaviour for a resmgr (using the standard resmgr
API in the clib).

chris

\

Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

Chris Rose <esorcc@hotmail.com> wrote:

If I control-C my client app that has a open connection to my resource
manager, how do I design the resource manager to recognize this situation
and close the channel?

It depends.

If the application is blocked on resource manager, you need to handle
unblock() like Chris point out.

If the application does not block on resource manager, then you only
need to handle close_ocb() (you already have that, right?), cause
when an application goes away, kernel will clean up all the connection
it have, and send an IO_CLOSE to res manager on behalf of the client.

The resource manager doesn’t really want to close the “channel” right?
(The connection is gone, but you still want to keep the channel, so
you got next open request). Well, if you want, you can “ChannelDestroy()”
in your close_ocb() handler.

-xtang