I have a WCF session service that starts a process and opens a named pipe for this process when the IsInitiating operation is called. When the IsTerminating operation is called, the service sends a message down the channel to inform the process at the other end that it might shut down. Unfortunately, if the client does not disconnect gracefully (by invoking the IsTerminating operation), then the message is never sent to the channel, and the other process never exits.
I tried to make my service an IDisposable implementation (in the hope that when the session ends on the server, it will call my Dispose method), but this does not seem to work.
Is there any way I can call the server-side code when the client disconnected (even if I need to wait for the Timeout to be inactive)?
source
share