How to shorten the Windows RPC call timeout?

1.7k views Asked by At

When I try to call a RPC function, which generated from an IDL file by midl tool, it blocks around 20 seconds (at the NdrGetBuffer function) if the IP bound in its RPC_BINDING_HANDLE is unreachable.

I tried to call RpcMgmtSetComTimeout function with RPC_C_BINDING_MIN_TIMEOUT value on its RPC_BINDING_HANDLE before calling that RPC function, but no help, still need to wait ~20 seconds.

Is there any way to shorten the timeout wait time on this case? Thanks a lot!

Elliott

1

There are 1 answers

1
Eric Brown On BEST ANSWER

I haven't tried this, but this link suggests that RpcSetBindingOption with RPC_C_OPT_CALL_TIMEOUT should allow you to set the callout.

However, there's still a 20 second timeout on the first call (so the server can start).