Skill shell thread. More...
Public Member Functions | |
SkillShellThread (ArgumentParser *argp) | |
Constructor. | |
~SkillShellThread () | |
Destructor. | |
virtual void | loop () |
Code to execute in the thread. | |
virtual void | deregistered (unsigned int id) throw () |
This handler has been deregistered. | |
virtual void | inbound_received (FawkesNetworkMessage *m, unsigned int id) throw () |
Called for incoming messages. | |
virtual void | connection_died (unsigned int id) throw () |
Client connection died. | |
virtual void | connection_established (unsigned int id) throw () |
Client has established a connection. |
Skill shell thread.
This thread opens a network connection to a host and uses a RemoteBlackBoard connection to send skill strings for execution. It also shows Skiller log messages and uses the skiller network protocol.
Definition at line 66 of file skillet.cpp.
SkillShellThread::SkillShellThread | ( | ArgumentParser * | argp | ) | [inline] |
Constructor.
argp | argument parser |
Definition at line 72 of file skillet.cpp.
References fawkes::ArgumentParser::parse_hostport().
SkillShellThread::~SkillShellThread | ( | ) | [inline] |
Destructor.
Definition at line 100 of file skillet.cpp.
virtual void SkillShellThread::connection_died | ( | unsigned int | id | ) | throw () [inline, virtual] |
Client connection died.
This method is used to inform handlers that the connection has died for any reason. No more data can be send and no more messages should be enqueued because it is unclear when they would be sent.
id | the id of the calling client |
Implements fawkes::FawkesNetworkClientHandler.
Definition at line 217 of file skillet.cpp.
virtual void SkillShellThread::connection_established | ( | unsigned int | id | ) | throw () [inline, virtual] |
Client has established a connection.
Whenever the client establishes a connection this is signaled to handlers with this method. You can register to a client at any time, you may even enqueue messages to a client while the connection is dead. If the client at some point gets connected again, the messages will then be send out in one go. You should use this in your application though to only send data if the connection is alive and you should let the user know about the connection status.
id | the id of the calling client |
Implements fawkes::FawkesNetworkClientHandler.
Definition at line 234 of file skillet.cpp.
virtual void SkillShellThread::deregistered | ( | unsigned int | id | ) | throw () [inline, virtual] |
This handler has been deregistered.
This is called when this handler is deregistered from the FawkesNetworkClient. Sometimes you may not want to allow this and post a big fat warning into the log.
id | the id of the calling client |
Implements fawkes::FawkesNetworkClientHandler.
Definition at line 206 of file skillet.cpp.
virtual void SkillShellThread::inbound_received | ( | FawkesNetworkMessage * | m, | |
unsigned int | id | |||
) | throw () [inline, virtual] |
Called for incoming messages.
This is called when an incoming message has been received. If this method was called one or more times then the a previously carried out wait(cid) call will continue.
m | Message to handle | |
id | the id of the calling client |
Implements fawkes::FawkesNetworkClientHandler.
Definition at line 211 of file skillet.cpp.
virtual void SkillShellThread::loop | ( | ) | [inline, virtual] |
Code to execute in the thread.
Implement this method to hold the code you want to be executed continously. If you do not implement this method, the default is that the thread will exit. This is useful if you choose to only implement once().
Reimplemented from fawkes::Thread.
Definition at line 119 of file skillet.cpp.
References fawkes::Exception::print_trace().