#include <cli.h>
Inheritance diagram for PCLISocket:

Operations | |
| bool | m_singleThreadForAll |
| PTCPSocket | m_listenSocket |
| PThread * | m_thread |
| ContextMap_t | m_contextBySocket |
| typedef std::map< PSocket *, Context * > | ContextMap_t |
| bool | Listen (WORD port=0) |
| WORD | GetPort () const |
| PDECLARE_NOTIFIER (PThread, PCLISocket, ThreadMain) | |
| bool | HandleSingleThreadForAll () |
| bool | HandleIncoming () |
Public Member Functions | |
Overrides from PCLI | |
| virtual bool | Start (bool runInBackground=true) |
| virtual void | Stop () |
| virtual Context * | AddContext (Context *context=NULL) |
| virtual void | RemoveContext (Context *context) |
typedef std::map<PSocket *, Context *> PCLISocket::ContextMap_t [protected] |
| PCLISocket::PCLISocket | ( | WORD | port = 0, |
|
| const char * | prompt = NULL, |
|||
| bool | singleThreadForAll = false | |||
| ) |
| PCLISocket::~PCLISocket | ( | ) |
| PCLISocket::PCLISocket | ( | WORD | port = 0, |
|
| const char * | prompt = NULL, |
|||
| bool | singleThreadForAll = false | |||
| ) |
| PCLISocket::~PCLISocket | ( | ) |
| virtual bool PCLISocket::Start | ( | bool | runInBackground = true |
) | [virtual] |
Start a command line interpreter. This will start listening for incoming TCP connections and create/dispatch contexts to handle them.
| runInBackground | Spawn a thread to read and interpret commands |
Reimplemented from PCLI.
| virtual void PCLISocket::Stop | ( | ) | [virtual] |
Stop and clean up command line interpreters. All the running contexts threads will be stopped, closing the channels and memory cleaned up.
The listening socket is also closed and the listener dispatch thread shut down.
Reimplemented from PCLI.
| virtual Context* PCLISocket::AddContext | ( | Context * | context = NULL |
) | [virtual] |
Add a command line interpreter context to the system. If context is NULL then CreateContext() is called to create one.
| virtual void PCLISocket::RemoveContext | ( | Context * | context | ) | [virtual] |
Remove the command line interpreter context. The context thread is stopped, the channel closed and memory deleted.
| bool PCLISocket::Listen | ( | WORD | port = 0 |
) |
Start listening socket.
| WORD PCLISocket::GetPort | ( | ) | const [inline] |
Get the port we are listing on.
| PCLISocket::PDECLARE_NOTIFIER | ( | PThread | , | |
| PCLISocket | , | |||
| ThreadMain | ||||
| ) | [protected] |
| bool PCLISocket::HandleSingleThreadForAll | ( | ) | [protected] |
| bool PCLISocket::HandleIncoming | ( | ) | [protected] |
bool PCLISocket::m_singleThreadForAll [protected] |
PTCPSocket PCLISocket::m_listenSocket [protected] |
PThread* PCLISocket::m_thread [protected] |
ContextMap_t PCLISocket::m_contextBySocket [protected] |
1.5.1