If one is making a call to a dynamic endpoint, RPC runtime will first try to
resolve the endpoint with the endpoint mapper on the server. On Windows XP,
the call timeout will not affect this internal endpoint resolution call, so
that call can take longer to time out, as seems to happen in your case.
This problem should not exist on Windows Server 2003.
Additional information on this general area is available at:
http://msdn.microsoft.com/library/en-us/rpc/rpc/rpc_and_the_network.asp
Also, please note that the best way to handle possible communication
latencies on slow networks is to use async RPC.
Writing a solid RPC application that works well over slow or unreliable
networks is difficult, but this is largely due to the inherent complexity of
dealing with such networks. Writing a distributed application using sockets
for such networks will be even more challenging, since RPC shields users
from the low-level details of the underlying protocols.
Greg
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Thore Karlsen [MVP DX]On Fri, 23 Jul 2004 09:07:23 +0200, "Frank Franzoni"
Post by Frank FranzoniPost by Thore Karlsen [MVP DX]Try RpcBindingSetOption with RPC_C_OPT_CALL_TIMEOUT. I've only tested it
briefly, but it seems to work. (Only on XP, though.)
Thanks for your quick answer.
I tried this option but it is behaving strangly. For the first rpc call it
still takes 20 seconds until the call is
returned with an error.
When the network is interrupted after the first successful rpc call, all
following calls are returned within the time set in the option.
I suspect that this 20 seconds timeout does not come from the rpc runtime
but from tcp/ip.
Do you have an idea where to shorten this 20 seconds?
It looks like the first RPC call is treated specially, and perhaps the
alternative code path doesn't respect the timeout. I tried looking at
the source code for the RPC implementation to see what was going on, but
it's too complex to get an overview quickly.
I'm not sure if there's a fix for this problem. I've searched for this
kind of information before (timeouts, call cancellation, asynchronous
calls), and there's precious little information about it apart from
MSDN. I get the impression very few people are using these facilities.
Or if they are, they must not be needing/seeking help online.
The lack of control you have over what's going on behind the scenes with
RPC is very frustrating, and if you expect to use it over faulty/slow
connections I would recommend (based on my experiences) that you at
least consider alternatives. Building a robust, responsive, and fault
tolerant application around RPC is extremely hard.
--
Be seeing you.