Ok.... I created the functions and signal handlers and everything works as far as not allowing new connections... Can anyone point me in the right direction on how to parse the active connections and disconnect them without killing the server completely. I tried a while loop, but that just caused the server to shutdown and reboot, effectively closing all connections, and then resetting my lock. Thanks, Dwight CODE BEGINS HERE (all code is contained in comm.c) : ------------------ SNIP ------------------------- int login = 0; /* to limit logins */ ------------------ SNIP ------------------------- RETSIGTYPE nologin (int sig); ------------------ SNIP ------------------------- my_signal(SIGALRM,nologin); ------------------ SNIP ------------------------- RETSIGTYPE nologin(int sig) { if (!login) { log("Recieved SIGALRM. Disallowing Logins..."); login=1; send_to_all("NOTICE: The mud is going down for maintenance. Your game will be saved and you will be disconnected now!"); Crash_save_all(); House_save_all(); /* Need to kill active connections here!! */ } else { log("Recieved SIGALRM. Allowing new logins..."); login=0; } } ------------------ SNIP ------------------------- /* check for login lock */ if (login) { write_to_descriptor(desc, "\r\n\r\nSorry, logins are not allowed at the current time. Please try again later!\r\n\r\n"); CLOSE_SOCKET(desc); return (0); } ------------------ SNIP ------------------------- ===== ........................................................... So in the dark we hide the heart that bleeds, And wait, and tend our agonizing seeds. - Countee Cullen. __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/06/01 PST