Call Manager is a single-threaded application. It's easier that way. Nothing blocks except a select() call. The pptp code provides an fd_set for us to watch, and a function to call to see if a given event pertains to the pptp code. Each CALL connection goes in the exceptions set, and is watched for close. We need a separate list of these, to check against the fd_set when an event happens. Writes get copied in a queue, and are only written if the select says we can. Reads go in another queue -- non-blocking! -- and messages are made from the queue as we are able. We register callbacks on significant events (any and all of them, if we please) which can trigger a close on a user unix socket, for example. Nomenclature: inet_read|write ... TCP port 1723 PPTP control connection unix_read|write ... Call manager Unix socket to pppd/gre.