Question

Is there any way to check the status of the RPC connection from the server-side? I am looking for a way to detect if the connection from the client is lost, be it client crash or other connectivity issues.

Was it helpful?

Solution

Use Context Handles for managing server state between calls for a particular client. RPC uses keep-alive's to detect client disconnects and will execute your context handle rundown routine if the client disconnects.

OTHER TIPS

Mo Flanagan's answer is the best IMHO. Some more context.

If you're using binding handles, there is no way of tracking state across RPC calls and the concept of a "client disconnect" is essentially meaningless - you still need to return from the RPC call.

If you're using context handles, then the RPC runtime library will call the _rundown function when the client disconnects.

When that routine is called, the server can clean up whatever it needs to.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top