Using Datagram Protocols
Microsoft RPC supports datagram (connectionless) protocols as well as connection-oriented protocols. Some of the features available when using datagram protocols are shown below:
-
Datagrams support the UDP and IPX connectionless transport protocols.
-
Because it is not necessary to establish and maintain a connection, resource overhead is less using the datagram RPC protocol.
-
Datagrams enable faster binding.
-
As with connection-oriented RPC, datagram RPC calls are by default nonidempotent. This means the call is guaranteed not to be executed more than once. However, a function can be marked as idempotent in the IDL file telling RPC that it is harmless to execute the function more than once in response to a single, client request. This allows the run time to maintain less state on the server. Note that an idempotent call would be re-executed only in rare circumstances on an unstable network.
-
Datagram RPC supports the broadcast IDL attribute. Broadcast enables a client to issue messages to multiple servers at the same time. This lets the client locate one of several available servers on the network, or control multiple servers simultaneously. Broadcast calls are implicitly idempotent. If the call contains [out] parameters, only the first server response is returned. Once a server responds, all future RPCs over that binding handle will be sent to that server only, including calls with the broadcast attribute. To send another broadcast, create a new binding handle or call RpcBindingReset on the existing handle.
-
Datagram RPC supports the maybe IDL attribute. This lets the client send a call to the server without waiting for a response or confirmation. The call cannot contain [out] parameters. Maybe calls are implicitly idempotent.