fawkes::FawkesNetworkClientSendThread Class Reference
[Fawkes Network Communication]
Fawkes network client send thread.
More...

Public Member Functions | |
| FawkesNetworkClientSendThread (StreamSocket *s, FawkesNetworkClient *parent) | |
| Constructor. | |
| ~FawkesNetworkClientSendThread () | |
| Destructor. | |
| virtual void | once () |
| Execute an action exactly once. | |
| virtual void | loop () |
| Code to execute in the thread. | |
| void | force_send () |
| Force sending of messages. | |
| void | enqueue (FawkesNetworkMessage *message) |
| Enqueue message to send. | |
Protected Member Functions | |
| virtual void | run () |
| Stub to see name in backtrace for easier debugging. | |
Detailed Description
Fawkes network client send thread.Spawned by the FawkesNetworkClient to handle outgoing traffic.
Definition at line 65 of file client.cpp.
Constructor & Destructor Documentation
| fawkes::FawkesNetworkClientSendThread::FawkesNetworkClientSendThread | ( | StreamSocket * | s, | |
| FawkesNetworkClient * | parent | |||
| ) | [inline] |
Constructor.
- Parameters:
-
s client stream socket parent parent FawkesNetworkClient instance
Definition at line 73 of file client.cpp.
| fawkes::FawkesNetworkClientSendThread::~FawkesNetworkClientSendThread | ( | ) | [inline] |
Member Function Documentation
| void fawkes::FawkesNetworkClientSendThread::enqueue | ( | FawkesNetworkMessage * | message | ) | [inline] |
Enqueue message to send.
- Parameters:
-
message message to send
Definition at line 142 of file client.cpp.
References fawkes::Mutex::lock(), fawkes::RefCount::ref(), fawkes::Mutex::unlock(), and fawkes::Thread::wakeup().
Referenced by fawkes::FawkesNetworkClient::enqueue(), and fawkes::FawkesNetworkClient::enqueue_and_wait().
| void fawkes::FawkesNetworkClientSendThread::force_send | ( | ) | [inline] |
Force sending of messages.
All messages are sent out immediately, if loop is not running already anyway.
Definition at line 131 of file client.cpp.
References loop(), fawkes::Thread::loop_mutex, fawkes::Mutex::try_lock(), and fawkes::Mutex::unlock().
Referenced by fawkes::FawkesNetworkClient::disconnect().
| virtual void fawkes::FawkesNetworkClientSendThread::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 105 of file client.cpp.
References fawkes::FawkesNetworkClient::connected(), fawkes::Thread::exit(), fawkes::Mutex::lock(), fawkes::FawkesNetworkTransceiver::send(), and fawkes::Mutex::unlock().
Referenced by force_send().
| virtual void fawkes::FawkesNetworkClientSendThread::once | ( | ) | [inline, virtual] |
Execute an action exactly once.
This code is executed once and only once right after the thread is started before loop() is called. This is useful if you want to implement an one-shot background job. Just implement once() and leave once() untouched. Start the thread and detach it and it will just do its job and then die automatically. If you use set_delete_on_exit(true) even the Thread instance will be automatically deleted.
Reimplemented from fawkes::Thread.
Definition at line 100 of file client.cpp.
| virtual void fawkes::FawkesNetworkClientSendThread::run | ( | ) | [inline, protected, virtual] |
Stub to see name in backtrace for easier debugging.
- See also:
- Thread::run()
Reimplemented from fawkes::Thread.
Definition at line 153 of file client.cpp.
The documentation for this class was generated from the following file:
- src/libs/netcomm/fawkes/client.cpp

