In article gjb@fig.citib.com (Greg Brail) writes: > > Call that "quitServer" routine that Thuan described after your call to > rpc_server_listen. In your signal handler, call > rpc_mgmt_stop_server_listening with a binding handle parameter of > NULL. This will make the server stop accepting RPCs and make > rpc_server_listen return. > A question: Will rpc_server_listen return immidiately after the call to rpc_mgmt_stop_server_listening, or will it block for executing RPCs to finish first? Or, more generally: are there any functions available to query the state of active RPC executor threads? Or would I have to build in that kind of checking by using global counters and the like? > > No need to bother if you don't feel like it. If you use > rpc_mgmt_stop_server_listening in your signal handler like I described > above, then any client can call it too once it has a binding to your > server. However, your server must call rpc_mgmt_set_authorization_fn > to register a callback that DCE will call whenever the client calls a > management routine. By default, stop_server_listening calls from > remote clients are rejected. Your callback must decide if the client > is authorized, then return "TRUE" if it wants the shutdown request to > be accepted. > But if you are using insecure RPC, all you get to check for authorization is the client binding handle. Which severely limits the servers possibilities to ascertain *who* out there made the request to stop the server. This is of course true even if you choose to implement the 'stop server' function as part of your interface, rather than using the RPC management routines. Of course you could make the client pass a password, magic cookie, or somesuch -- but then you start implementing yourself exactly the functions that the authentication services are there to perform. Bj�