S3FC project page | S3FC home page |
Inheritance diagram for s3_txport_tcp_tx_task:
Public Methods | |
void | main_loop () |
Main thread loop, not to be called. More... | |
void | set_terminate () |
Private Methods | |
s3_txport_tcp_tx_task (s3_fifo_queue< s3_txport_data< T_Data > > &a_q, s3_txport_tcp< T_Data, T_Socket > *a_parent) | |
Default constructor. More... | |
~s3_txport_tcp_tx_task () | |
Destructor. More... | |
void | handle_failure (s3_txport_client_id id, std::string err_msg) |
Routine to handle failures detected by the tcp system. More... | |
void | cleanup () |
Clean up the odds and ends we started. More... | |
Private Attributes | |
s3_semaphore | sem |
The semaphore which signals the various events. More... | |
s3_fifo_queue< s3_txport_data< T_Data > > & | in_q |
Queue for data received. More... | |
s3_pack_buffer | b |
Streamable buffer for POD, as all data must be serialised. More... | |
s3_txport_tcp< T_Data, T_Socket > * | parent |
Parent server thread. More... | |
s3_semaphore | terminate |
Set to true if we must terminate the thread. More... | |
s3_periodic_notifier | pn |
Periodic notifier for our "select()" and timeout. More... | |
std::list< s3_txport_client_id > | id_list |
Internal list needed to track where to send data in broadcasts. More... | |
Friends | |
class | s3_txport_tcp< T_Data, T_Socket > |
This class waits on a queue for data to be sent to a designated client that is currently connected to the server. The queue data type is of s3_txport_data and contains both an s3_streamable payload as well as an s3_txport_client_id indicating the desired destination for the payload. If the designated client has closed the connection, the payload is dropped and the offending client is earmarked for termination. The error is reported by the s3_event_dispatcher() mechanism. This thread is responsible for reaping rx threads earmarked for termination. The thread runs under an s3_periodic_notifier() to ensure that it is woken up to reap the dead tasks, irrespective of inputs to the queue. If this thread blocks in the tcp_send function, then it will not reap dead connections and things will get stuck.
Definition at line 65 of file s3_txport_tcp.tcc.
|
Default constructor.
Definition at line 117 of file s3_txport_tcp.tcc. References pn, sem, s3_periodic_notifier::set_period, and s3_periodic_notifier::subscribe. |
|
Destructor.
Definition at line 87 of file s3_txport_tcp.tcc. |
|
Clean up the odds and ends we started.
Reimplemented from s3_thread_base. Definition at line 128 of file s3_txport_tcp.tcc. References s3_periodic_notifier::disable, in_q, parent, pn, and sem. |
|
Routine to handle failures detected by the tcp system.
Definition at line 93 of file s3_txport_tcp.tcc. Referenced by main_loop. |
|
Main thread loop, not to be called.
Implements s3_thread_base. Definition at line 136 of file s3_txport_tcp.tcc. References b, s3_fifo_queue< s3_txport_data< T_Data > >::close_output, s3_periodic_notifier::enable, s3_txport_event::error, s3_pack_buffer::get_buffer, s3_pack_buffer::get_size, handle_failure, id_list, in_q, s3_fifo_queue< s3_txport_data< T_Data > >::nbl_open_output, s3_streamable::pack, parent, pn, s3_pack_buffer::reset, s3_txport_client_id, S3FC_DBG, sem, terminate, s3_semaphore::try_wait, and s3_semaphore::wait. |
|
Definition at line 108 of file s3_txport_tcp.tcc. |
|
Definition at line 113 of file s3_txport_tcp.tcc. |
|
Streamable buffer for POD, as all data must be serialised.
Definition at line 72 of file s3_txport_tcp.tcc. Referenced by main_loop. |
|
Internal list needed to track where to send data in broadcasts.
Definition at line 80 of file s3_txport_tcp.tcc. Referenced by main_loop. |
|
Queue for data received.
Definition at line 70 of file s3_txport_tcp.tcc. |
|
Parent server thread.
Definition at line 74 of file s3_txport_tcp.tcc. |
|
Periodic notifier for our "select()" and timeout.
Definition at line 78 of file s3_txport_tcp.tcc. Referenced by cleanup, main_loop, and s3_txport_tcp_tx_task. |
|
The semaphore which signals the various events.
Definition at line 68 of file s3_txport_tcp.tcc. Referenced by cleanup, main_loop, and s3_txport_tcp_tx_task. |
|
Set to true if we must terminate the thread.
Definition at line 76 of file s3_txport_tcp.tcc. Referenced by main_loop. |
Send comments to: s3fc@stonethree.com |
|