RpcMgmtSetComTimeout  4220AR

The RpcMgmtSetComTimeout function sets the binding-communications timeout value in a binding handle.

#include <rpc.h>

RPC_STATUS RPC_ENTRY RpcMgmtSetComTimeout(

    RPC_BINDING_HANDLE  Binding,

 

    unsigned int  Timeout

 

   );

 

 

Parameters

Binding

Specifies the server binding handle whose timeout value is set.

Timeout

Specifies the communications timeout value.

 

Remarks

A client application calls RpcMgmtSetComTimeout to change the communications timeout value for a server binding handle. The timeout value specifies the relative amount of time that should be spent to establish a relationship to the server before giving up. Depending on the protocol sequence for the specified binding handle, the timeout value acts only as a hint to the RPC run-time library.

After the initial relationship is established, subsequent communications for the binding handle revert to not less than the default timeout for the protocol service. This means that after setting a short initial timeout establishing a connection, calls in progress will not be timed out any more aggressively than the default.

The timeout value can be any integer value from 0 to 10. For convenience, constants are provided for certain values in the timeout range. The following table contains the RPC-defined values that an application can use for the timeout argument:

Manifest

Value

Description

RPC_C_BINDING_INFINITE_TIMEOUT

10

Keep trying to establish communications forever.

RPC_C_BINDING_MIN_TIMEOUT

0

Try the minimum amount of time for the network protocol being used. This value favors response time over correctness in determining whether the server is running.

RPC_C_BINDING_DEFAULT_TIMEOUT

5

Try an average amount of time for the network protocol being used. This value gives correctness in determining whether a server is running and gives response time equal weight. This is the default value.

RPC_C_BINDING_MAX_TIMEOUT

9

Try the longest amount of time for the network protocol being used. This value favors correctness in determining whether a server is running over response time.

 

 

Note  The values in the preceding table are not in seconds. These values represent a relative amount of time on a scale of zero to 10.

 

Return Values

Value

Meaning

RPC_S_OK

Success

RPC_S_INVALID_BINDING

Invalid binding handle

RPC_S_INVALID_TIMEOUT

Invalid timeout value

RPC_S_WRONG_KIND_OF_BINDING

Wrong kind of binding for operation

 

See Also

RpcMgmtInqComTimeout