Revision: 14333 Author: adrian.chadd Date: Mon Oct 19 00:28:50 2009 Log: Edited wiki page through web user interface. http://code.google.com/p/lusca-cache/source/detail?r=14333
Modified: /wiki/LuscaArchitectureHelperIPC.wiki ======================================= --- /wiki/LuscaArchitectureHelperIPC.wiki Mon Oct 19 00:23:37 2009 +++ /wiki/LuscaArchitectureHelperIPC.wiki Mon Oct 19 00:28:50 2009 @@ -25,4 +25,16 @@ As far as the existing code is concerned - all the modules use IPC_STREAM (mapping to one of the TCP/FIFO/STREAM types) save for the ICMP code which uses IPC_DGRAM (mapping to one of the UDP/DGRAM types.) += Implementation = + +ipcCreate() will fork() Lusca, setup the socket environment as per the requested IPC type, and execute the new process. The new process will have STDIN/STDOUT mapped to the requested socket types. The new process will have STDERR mapped to the Lusca debug log filedescriptor. This means that printing to stderr from a helper will appear in the lusca debug.log file. + +There is an initial "chat" session between the main Lusca process and the newly-forked child process before the child exec's the replacement process. This is done to ensure that basic bidirectional IO is possible over the newly created socket pairs. The helper program doesn't need to do any of this. + +Lusca will close all other open file descriptors (save STDIN/STDOUT/STDERR) after exec(). + = Using the API = + +ipcCreate() implements the public facing API. It returns the pid of the child process or -1 on failure. If successful, the rfd/wfd pointers will be set to the filedescriptors used for reading and writing to the child process. These file descriptors can then be passed to commSetSelect() to schedule for comm IO readiness just like any other socket. + +Like any normal socket, EOF is detected by the read socket being ready for reading but a read returning 0. Similarly, an error is detected by the read socket being ready for reading but a read returning an error. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "lusca-commit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/lusca-commit?hl=en -~----------~----~----~----~------~----~------~--~---
