I'm not really in to all this fork/deamon/nonblocking connections and whatever other fancy words i can come up with.. Me neither, so I trust someone will correct me if I'm wrong. BUT, I noticed that the doc-file (the ident.h file :) has some different functions, and some of them should be able to do the same as the ident_id() call the library provides - BUT NONBLOCKING ... Now to me it seams that teh idea of forking a process off the main mud routine, or making a seperate deamon (wich I have no idea how do make :), is all for teh purpose of getting a nonblocking socket I/O. Well, I don't know that it has anything to do with blocking or not blocking sockets. Rather, the reason that it would cause the mud to halt is, the mud is single threaded. It goes around to each descriptor, checks for input, processes it until done, and then goes to the next descriptor. 99.9% of the functions that get called execute relatively instantly so there is no lag in the game. But a couple of the functions (such as gethostbyaddr() and apparently this ident_id() thing), because of the function they perform (connecting to a remote host and waiting for information), can take up to several seconds or more to exit. From the rest of the game's perspective, its just waiting for that function to exit. So the game stops until that function is done. So the idea of forking the process is so that the ident_id can do its thing and wait for the response from the foreign host while the mud continues on its merry way. I hope this is correct, I am pretty much guessing, so someone please slap me in the mouth if I'm wrong! ;-)
This archive was generated by hypermail 2b30 : 12/07/00 PST