From 73cb610641b9d69aea0f75b6ccd26236e6c8c3fc Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 31 Oct 2006 20:22:40 +0000 Subject: Update to ConnectionManager, things are much, much better now. --- src/connectionmanager.cpp | 2 +- src/programchain.h | 99 +++++++++++++++++++++++++---------------------- src/programlink.h | 2 +- 3 files changed, 55 insertions(+), 48 deletions(-) diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp index 8b62026..3e9f1a8 100644 --- a/src/connectionmanager.cpp +++ b/src/connectionmanager.cpp @@ -77,7 +77,7 @@ bool ConnectionManager::startServer( int nPort ) return false; } - if (listen (nMasterSocket, 1) < 0) + if (listen (nMasterSocket, 40) < 0) { xLog.LineLog( MultiLog::LError, "Couldn't begin listening to the server socket."); return false; diff --git a/src/programchain.h b/src/programchain.h index 1752d2c..2bdfeee 100644 --- a/src/programchain.h +++ b/src/programchain.h @@ -5,10 +5,11 @@ #include "multilog.h" #include "programlink.h" -/** The Program Chain links together program "chunks" to more easily facilitate - * a generalized program loop with modular extensions. - *@author Mike Buland - */ +/** + * The Program Chain links together program "chunks" to more easily facilitate + * a generalized program loop with modular extensions. + *@author Mike Buland + */ class ProgramChain { public: @@ -22,58 +23,64 @@ public: */ virtual ~ProgramChain(); - /** Adds a link to the end of the chain. - *@param pLink A pointer to the link to add to the chain. - *@returns True if adding the link was successful, otherwise false - *@author Mike Buland - */ + /** + * Adds a link to the end of the chain. + *@param pLink A pointer to the link to add to the chain. + *@returns True if adding the link was successful, otherwise false + *@author Mike Buland + */ bool addLink( ProgramLink *pLink ); - /** Gets a link by name. - *@param lpName The name of the link you're looking for. Every link has a - * name, apparently. - *@returns A pointer to the specified ProgramLink, or NULL if none were found - * matching your criteria. - *@author Mike Buland - */ + /** + * Gets a link by name. + *@param lpName The name of the link you're looking for. Every link has a + * name, apparently. + *@returns A pointer to the specified ProgramLink, or NULL if none were + * found matching your criteria. + *@author Mike Buland + */ class ProgramLink *getLink( const char *lpName ); - /** Gets the very first link in the chain. - *@returns A pointer to the first link in the chain. - *@author Mike Buland - */ + /** + * Gets the very first link in the chain. + *@returns A pointer to the first link in the chain. + *@author Mike Buland + */ class ProgramLink *getBaseLink(); - /** Runs through the chain once. Useful if you want to have more control over - * the operation of the chain. - *@returns true if every link returned true. If at least one link returns false, - * then returns false. - *@author Mike Buland - */ + /** + * Runs through the chain once. Useful if you want to have more control + * over the operation of the chain. + *@returns true if every link returned true. If at least one link returns + * false, then returns false. + *@author Mike Buland + */ bool execChainOnce(); - /** Enters the master chain loop, looping over the entire chain and executing - * every link's TimeSlice routine in order, over and over, until a link returns - * a false value. - *@returns False, always. It returns true unless a link returned false, but loops - * until a link does return false. - *@author Mike Buland - **/ + /** + * Enters the master chain loop, looping over the entire chain and + * executing every link's TimeSlice routine in order, over and over, until + * a link returns a false value. + *@returns False, always. It returns true unless a link returned false, + * but loops until a link does return false. + *@author Mike Buland + **/ bool enterChainLoop(); - /** Broadcasts an Immediate Response Message to all active links, save the - * sender. Whatever link first responds with a non-null response message - * will have it's messages sent back to the broadcasting link as the returns - * of this function call. Therefore it is very important that all message - * processing code is handled in a fairly timely fasion. - *@param pMsgOut The message to broadcast in hopes of a response. - *@param pSender The message that sent out the message and doesn't want to - * receive it's own message. This should always just be "this". - *@returns The message that was returned by the first link to return a - * non-null response. If all messages return null responses then this also - * returns null. Please note that whoever calls this will be responsible - * for deleting the message returned by it, if non-null. - */ + /** + * Broadcasts an Immediate Response Message to all active links, save the + * sender. Whatever link first responds with a non-null response message + * will have it's messages sent back to the broadcasting link as the returns + * of this function call. Therefore it is very important that all message + * processing code is handled in a fairly timely fasion. + *@param pMsgOut The message to broadcast in hopes of a response. + *@param pSender The message that sent out the message and doesn't want to + * receive it's own message. This should always just be "this". + *@returns The message that was returned by the first link to return a + * non-null response. If all messages return null responses then this also + * returns null. Please note that whoever calls this will be responsible + * for deleting the message returned by it, if non-null. + */ class LinkMessage *broadcastIRM( LinkMessage *pMsgOut, ProgramLink *pSender ); private: diff --git a/src/programlink.h b/src/programlink.h index 6499fc2..f93edcc 100644 --- a/src/programlink.h +++ b/src/programlink.h @@ -70,7 +70,7 @@ public: private: /** - * Set which chain we're assosiated with. This is hope IRM messages make + * Set which chain we're assosiated with. This is how IRM messages make * it out to the rest of the world. *@param pNewChain A pointer to the containing program chain. */ -- cgit v1.2.3