## Communications Failures

If a server detects a communications failure during a remote procedure call, the server runtime attempts to terminate the now orphaned call by sending a cancel to the called procedure. A cancel is a mechanism by which a client thread of execution notifies a server thread of execution (the to be canceled thread) to terminate as soon as possible. A cancel sent by the RPC runtime after a communications failure initiates orderly termination for a remote procedure call. (For a brief discussion of how cancels work with remote procedure calls, see Thread Cancellation.)

Applications that use context handles to establish a client context require a context rundown procedure to enable the server to clean up client context when it is no longer needed. The name of the context rundown procedure is determined from the type name of the context handle declared in the interface definition; this ensures that the stub knows about the procedure in the server application code. If a communications link with a client is lost while a server is maintaining context for the client, the RPC runtime will inform the server to invoke the context rundown procedure. For a more thorough discussion of context handles see Topics in RPC Application Development.

##