PreviousNext

Listening for Calls

When a server is ready to accept remote procedure calls, it initiates listening, specifying the maximum number of calls it can execute concurrently; it does this by calling the rpc_server_listen(~) routine. If a server allows concurrent calls, its remote procedures are responsible for concurrency control. If executing a set of remote procedures concurrently requires concurrency control and a server lacks this control, the server must allow only one call at a time.

Under normal circumstances, the rpc_server_listen( ) routine does not return but the RPC runtime continues listening for new remote procedure calls to the server's registered interfaces until one of the following events occurs:

· Any of the server's procedures makes a local management call to stop a server from listening for future remote procedure calls.

· For applications whose servers enable clients to stop servers from listening, a client makes a remote management call to stop a server from listening for future remote procedure calls.

On receipt of a stop listening request, the RPC runtime stops accepting new remote procedure calls for all registered interfaces. However, currently executing calls are allowed to complete. After all executing calls complete, the listen operation stops listening and returns control to the server. Servers should unregister endpoints after they stop listening.