Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ConnectionReader Class Reference

#include <connectionReader.h>

Inheritance diagram for ConnectionReader:

ConnectionListener QueuedConnectionReader RecentConnectionReader QueuedConnectionListener List of all members.

Protected Member Functions

virtual void receive_datagram (const NetDatagram &datagram)=0
void shutdown ()
void clear_manager ()
void finish_socket (SocketInfo *sinfo)
virtual void process_incoming_data (SocketInfo *sinfo)
virtual void process_incoming_udp_data (SocketInfo *sinfo)
virtual void process_incoming_tcp_data (SocketInfo *sinfo)
virtual void process_raw_incoming_udp_data (SocketInfo *sinfo)
virtual void process_raw_incoming_tcp_data (SocketInfo *sinfo)

Protected Attributes

ConnectionManager_manager

Private Types

typedef pvector< PRThread * > Threads
typedef pvector< PRPollDesc > Poll
typedef pvector< SocketInfo * > Sockets

Private Member Functions

virtual ~ConnectionReader ()
bool add_connection (const PT(Connection)&connection)
bool remove_connection (const PT(Connection)&connection)
bool is_connection_ok (const PT(Connection)&connection)
void poll ()
ConnectionManagerget_manager () const
bool is_polling () const
int get_num_threads () const
void set_raw_mode (bool mode)
bool get_raw_mode () const
void thread_run ()
SocketInfoget_next_available_socket (PRIntervalTime timeout, PRInt32 current_thread_index)
void rebuild_poll_list ()

Static Private Member Functions

void thread_start (void *data)

Private Attributes

PUBLISHED __pad0__: ConnectionReader(ConnectionManager *manager
PUBLISHED int num_threads
bool _raw_mode
bool _shutdown
Threads _threads
PRLock * _startup_mutex
bool _polling
Poll _poll
Sockets _polled_sockets
int _next_index
int _num_results
PRLock * _select_mutex
PRInt32 _currently_polling_thread
Sockets _sockets
Sockets _removed_sockets
bool _reexamine_sockets
PRLock * _sockets_mutex

Friends

class ConnectionManager

Member Typedef Documentation

typedef pvector<PRPollDesc> ConnectionReader::Poll [private]
 

Definition at line 135 of file connectionReader.h.

typedef pvector<SocketInfo *> ConnectionReader::Sockets [private]
 

Definition at line 136 of file connectionReader.h.

Referenced by rebuild_poll_list().

typedef pvector<PRThread *> ConnectionReader::Threads [private]
 

Definition at line 128 of file connectionReader.h.


Constructor & Destructor Documentation

ConnectionReader::~ConnectionReader  )  [private, virtual]
 

Definition at line 128 of file connectionReader.cxx.

References ConnectionReader::SocketInfo::_busy, _manager, _removed_sockets, _select_mutex, _sockets, _sockets_mutex, _startup_mutex, NULL, ConnectionManager::remove_reader(), and shutdown().


Member Function Documentation

bool ConnectionReader::add_connection const PT(Connection)&  connection  )  [private]
 

Definition at line 177 of file connectionReader.cxx.

References _reexamine_sockets, _sockets, _sockets_mutex, and NULL.

void ConnectionReader::clear_manager  )  [protected]
 

Definition at line 392 of file connectionReader.cxx.

References _manager, and NULL.

void ConnectionReader::finish_socket SocketInfo sinfo  )  [protected]
 

Definition at line 403 of file connectionReader.cxx.

References ConnectionReader::SocketInfo::_busy, and _reexamine_sockets.

Referenced by ConnectionListener::process_incoming_data(), process_incoming_tcp_data(), process_incoming_udp_data(), process_raw_incoming_tcp_data(), and process_raw_incoming_udp_data().

ConnectionManager * ConnectionReader::get_manager  )  const [private]
 

Definition at line 299 of file connectionReader.cxx.

References _manager.

ConnectionReader::SocketInfo * ConnectionReader::get_next_available_socket PRIntervalTime  timeout,
PRInt32  current_thread_index
[private]
 

Definition at line 835 of file connectionReader.cxx.

References ConnectionReader::SocketInfo::_busy, _currently_polling_thread, ConnectionReader::SocketInfo::_error, _manager, _next_index, _num_results, _poll, _polled_sockets, _reexamine_sockets, _select_mutex, _shutdown, ConnectionManager::connection_reset(), max_timeout_ms, NULL, pprerror(), and rebuild_poll_list().

Referenced by poll(), and thread_run().

int ConnectionReader::get_num_threads  )  const [private]
 

Definition at line 321 of file connectionReader.cxx.

References _threads.

bool ConnectionReader::get_raw_mode  )  const [private]
 

Definition at line 345 of file connectionReader.cxx.

References _raw_mode.

bool ConnectionReader::is_connection_ok const PT(Connection)&  connection  )  [private]
 

Definition at line 245 of file connectionReader.cxx.

References ConnectionReader::SocketInfo::_error, _sockets, and _sockets_mutex.

bool ConnectionReader::is_polling  )  const [private]
 

Definition at line 310 of file connectionReader.cxx.

References _polling.

void ConnectionReader::poll  )  [private]
 

Definition at line 281 of file connectionReader.cxx.

References _polling, get_next_available_socket(), NULL, and process_incoming_data().

Referenced by QueuedConnectionReader::data_available(), and QueuedConnectionListener::new_connection_available().

void ConnectionReader::process_incoming_data SocketInfo sinfo  )  [protected, virtual]
 

Reimplemented in ConnectionListener.

Definition at line 439 of file connectionReader.cxx.

References ConnectionReader::SocketInfo::is_udp(), process_incoming_tcp_data(), process_incoming_udp_data(), process_raw_incoming_tcp_data(), and process_raw_incoming_udp_data().

Referenced by poll(), and thread_run().

void ConnectionReader::process_incoming_tcp_data SocketInfo sinfo  )  [protected, virtual]
 

Definition at line 532 of file connectionReader.cxx.

References _manager, _shutdown, buffer, ConnectionManager::connection_reset(), finish_socket(), DatagramTCPHeader::get_datagram_size(), ConnectionReader::SocketInfo::get_socket(), NULL, pprerror(), read_buffer_size, receive_datagram(), NetDatagram::set_address(), NetDatagram::set_connection(), and DatagramTCPHeader::verify_datagram().

Referenced by process_incoming_data().

void ConnectionReader::process_incoming_udp_data SocketInfo sinfo  )  [protected, virtual]
 

Definition at line 461 of file connectionReader.cxx.

References _manager, buffer, ConnectionManager::connection_reset(), finish_socket(), ConnectionReader::SocketInfo::get_socket(), NULL, pprerror(), read_buffer_size, receive_datagram(), NetDatagram::set_address(), NetDatagram::set_connection(), and DatagramUDPHeader::verify_datagram().

Referenced by process_incoming_data().

void ConnectionReader::process_raw_incoming_tcp_data SocketInfo sinfo  )  [protected, virtual]
 

Definition at line 727 of file connectionReader.cxx.

References _manager, buffer, ConnectionManager::connection_reset(), finish_socket(), ConnectionReader::SocketInfo::get_socket(), NULL, pprerror(), read_buffer_size, receive_datagram(), NetDatagram::set_address(), and NetDatagram::set_connection().

Referenced by process_incoming_data().

void ConnectionReader::process_raw_incoming_udp_data SocketInfo sinfo  )  [protected, virtual]
 

Definition at line 675 of file connectionReader.cxx.

References _manager, buffer, ConnectionManager::connection_reset(), finish_socket(), ConnectionReader::SocketInfo::get_socket(), NULL, pprerror(), read_buffer_size, receive_datagram(), NetDatagram::set_address(), and NetDatagram::set_connection().

Referenced by process_incoming_data().

void ConnectionReader::rebuild_poll_list  )  [private]
 

Definition at line 952 of file connectionReader.cxx.

References ConnectionReader::SocketInfo::_busy, ConnectionReader::SocketInfo::_error, _poll, _polled_sockets, _removed_sockets, _sockets, _sockets_mutex, ConnectionReader::SocketInfo::get_socket(), and Sockets.

Referenced by get_next_available_socket().

virtual void ConnectionReader::receive_datagram const NetDatagram datagram  )  [protected, pure virtual]
 

Implemented in ConnectionListener, QueuedConnectionReader, and RecentConnectionReader.

Referenced by process_incoming_tcp_data(), process_incoming_udp_data(), process_raw_incoming_tcp_data(), and process_raw_incoming_udp_data().

bool ConnectionReader::remove_connection const PT(Connection)&  connection  )  [private]
 

Definition at line 211 of file connectionReader.cxx.

References _reexamine_sockets, _removed_sockets, _sockets, and _sockets_mutex.

void ConnectionReader::set_raw_mode bool  mode  )  [private]
 

Definition at line 334 of file connectionReader.cxx.

References _raw_mode, and mode.

void ConnectionReader::shutdown  )  [protected]
 

Definition at line 356 of file connectionReader.cxx.

References _shutdown, _threads, and pprerror().

Referenced by ~ConnectionReader(), QueuedConnectionListener::~QueuedConnectionListener(), QueuedConnectionReader::~QueuedConnectionReader(), and RecentConnectionReader::~RecentConnectionReader().

void ConnectionReader::thread_run  )  [private]
 

Definition at line 797 of file connectionReader.cxx.

References _polling, _shutdown, _startup_mutex, _threads, get_next_available_socket(), NULL, and process_incoming_data().

void ConnectionReader::thread_start void *  data  )  [static, private]
 

Definition at line 786 of file connectionReader.cxx.

References data.


Friends And Related Function Documentation

friend class ConnectionManager [friend]
 

Definition at line 163 of file connectionReader.h.


Member Data Documentation

PUBLISHED ConnectionReader::__pad0__ [private]
 

Reimplemented in ConnectionListener, QueuedConnectionListener, QueuedConnectionReader, and RecentConnectionReader.

Definition at line 72 of file connectionReader.h.

PRInt32 ConnectionReader::_currently_polling_thread [private]
 

Definition at line 148 of file connectionReader.h.

Referenced by get_next_available_socket().

ConnectionManager* ConnectionReader::_manager [protected]
 

Definition at line 122 of file connectionReader.h.

Referenced by clear_manager(), get_manager(), get_next_available_socket(), ConnectionListener::process_incoming_data(), process_incoming_tcp_data(), process_incoming_udp_data(), process_raw_incoming_tcp_data(), process_raw_incoming_udp_data(), and ~ConnectionReader().

int ConnectionReader::_next_index [private]
 

Definition at line 139 of file connectionReader.h.

Referenced by get_next_available_socket().

int ConnectionReader::_num_results [private]
 

Definition at line 140 of file connectionReader.h.

Referenced by get_next_available_socket().

Poll ConnectionReader::_poll [private]
 

Definition at line 137 of file connectionReader.h.

Referenced by get_next_available_socket(), and rebuild_poll_list().

Sockets ConnectionReader::_polled_sockets [private]
 

Definition at line 138 of file connectionReader.h.

Referenced by get_next_available_socket(), and rebuild_poll_list().

bool ConnectionReader::_polling [private]
 

Definition at line 131 of file connectionReader.h.

Referenced by is_polling(), poll(), and thread_run().

bool ConnectionReader::_raw_mode [private]
 

Definition at line 125 of file connectionReader.h.

Referenced by get_raw_mode(), and set_raw_mode().

bool ConnectionReader::_reexamine_sockets [private]
 

Definition at line 158 of file connectionReader.h.

Referenced by add_connection(), finish_socket(), get_next_available_socket(), and remove_connection().

Sockets ConnectionReader::_removed_sockets [private]
 

Definition at line 155 of file connectionReader.h.

Referenced by rebuild_poll_list(), remove_connection(), and ~ConnectionReader().

PRLock* ConnectionReader::_select_mutex [private]
 

Definition at line 143 of file connectionReader.h.

Referenced by get_next_available_socket(), and ~ConnectionReader().

bool ConnectionReader::_shutdown [private]
 

Definition at line 126 of file connectionReader.h.

Referenced by get_next_available_socket(), process_incoming_tcp_data(), shutdown(), and thread_run().

Sockets ConnectionReader::_sockets [private]
 

Definition at line 152 of file connectionReader.h.

Referenced by add_connection(), is_connection_ok(), rebuild_poll_list(), remove_connection(), and ~ConnectionReader().

PRLock* ConnectionReader::_sockets_mutex [private]
 

Definition at line 160 of file connectionReader.h.

Referenced by add_connection(), is_connection_ok(), rebuild_poll_list(), remove_connection(), and ~ConnectionReader().

PRLock* ConnectionReader::_startup_mutex [private]
 

Definition at line 130 of file connectionReader.h.

Referenced by thread_run(), and ~ConnectionReader().

Threads ConnectionReader::_threads [private]
 

Definition at line 129 of file connectionReader.h.

Referenced by get_num_threads(), shutdown(), and thread_run().

PUBLISHED int ConnectionReader::num_threads [private]
 

Reimplemented in ConnectionListener, QueuedConnectionListener, and QueuedConnectionReader.

Definition at line 72 of file connectionReader.h.


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:11:43 2003 for Panda by doxygen1.3