return cci_check_error (err);
}
+
+/* ------------------------------------------------------------------------ */
+
+cc_uint64 ccs_server_client_count ()
+{
+ return ccs_client_array_count (g_client_array);
+}
ParseOpts::Opts opts = { 0 };
ParseOpts PO;
- BOOL bQuit = FALSE;
+ BOOL bQuitIfNoClients = FALSE;
opts.cMinCalls = 1;
opts.cMaxCalls = 20;
threadStatus = _beginthread(receiveLoop, 0, (void*)&rpcargs);
/* We handle the queue entries here. Work loop: */
- while (!bQuit) {
+ while (ccs_server_client_count() > 0 || !bQuitIfNoClients) {
worklist_wait();
while (!worklist_isEmpty()) {
k5_ipc_stream buf = NULL;
ccs_pipe_t pipe2 = NULL;
if (worklist_remove(&rpcmsg, &pipe, &buf, &serverStartTime)) {
- if (rpcmsg == CCMSG_QUIT) {
- bQuit = TRUE;
- break;
- }
uuid = ccs_win_pipe_getUuid(pipe);
#if 0
cci_debug_printf("%s: processing WorkItem msg:%ld pipeUUID:<%s> pipeHandle:0x%X SST:%ld",
err = krb5int_ipc_stream_write(stream, "This is a test of the emergency broadcasting system", 52);
err = ccs_os_server_send_reply(pipe, stream);
break;
+ case CCMSG_QUIT:
+ bQuitIfNoClients = TRUE;
+ break;
default:
cci_debug_printf("Huh? Received invalid message type %ld from UUID:<%s>",
rpcmsg, uuid);