How to get RPC notification when a client terminates?
Danny Mayer
mayer at ntp.isc.org
Wed Nov 14 00:12:58 EST 2007
Kevin Koch wrote:
> Windows experts: how can my RPC server learn that a client has gone away?
> The server needs to know because it may have state that needs to be cleaned
> up.
>
> A) One method is for a server thread to send an RPC message to the client,
> which the client never finishes processing. The server thread will get an
> RPC exception when the client dies.
>
> B) Another method is for the server to hold the state until it has a reason
> to talk to the client. Then it can notice that the client is not reachable.
>
> Is there any other way that has the benefits of method A (immediate
> discovery, less resource consumption) without an outstanding RPC call for
> each client?
>
> The server must be able to handle requests from all clients while
> simultaneously detecting any client exiting.
>
I/O Completion Ports is designed for this kind of thing. That's what you
should be using if that's the goal.
Danny
More information about the kfwdev
mailing list