Panda3D
 All Classes Functions Variables Enumerations
Public Member Functions | List of all members
QueuedConnectionManager Class Reference

This flavor of ConnectionManager will queue up all of the reset-connection messages from the ConnectionReaders and ConnectionWriters and report them to the client on demand. More...

#include "queuedConnectionManager.h"

Inheritance diagram for QueuedConnectionManager:
ConnectionManager QueuedReturn< PT(Connection) >

Public Member Functions

bool get_reset_connection (PT(Connection)&connection)
 If a previous call to reset_connection_available() returned true, this function will return information about the newly reset connection. More...
 
bool reset_connection_available () const
 Returns true if one of the readers/writers/listeners reported a connection reset recently. More...
 
- Public Member Functions inherited from ConnectionManager
bool close_connection (const PT(Connection)&connection)
 Terminates a UDP or TCP socket previously opened. More...
 
const Interfaceget_interface (int n)
 Returns the nth usable network interface detected on this machine. More...
 
int get_num_interfaces ()
 This returns the number of usable network interfaces detected on this machine. More...
 
 MAKE_SEQ (get_interfaces, get_num_interfaces, get_interface)
 
 PT (Connection) open_UDP_connection(int port=0)
 
 PT (Connection) open_UDP_connection(const string &hostname
 
 PT (Connection) open_TCP_server_rendezvous(int port
 
 PT (Connection) open_TCP_server_rendezvous(const string &hostname
 
 PT (Connection) open_TCP_server_rendezvous(const NetAddress &address
 
 PT (Connection) open_TCP_client_connection(const NetAddress &address
 
 PT (Connection) open_TCP_client_connection(const string &hostname
 
void scan_interfaces ()
 Repopulates the list reported by get_num_interface()/get_interface(). More...
 
bool wait_for_readers (double timeout)
 Blocks the process for timeout number of seconds, or until any data is available on any of the non-threaded ConnectionReaders or ConnectionListeners, whichever comes first. More...
 
- Public Member Functions inherited from QueuedReturn< PT(Connection) >
int get_current_queue_size () const
 
int get_max_queue_size () const
 
bool get_overflow_flag () const
 
void reset_overflow_flag ()
 
void set_max_queue_size (int max_size)
 

Additional Inherited Members

- Static Public Member Functions inherited from ConnectionManager
static string get_host_name ()
 Returns the name of this particular machine on the network, if available, or the empty string if the hostname cannot be determined. More...
 
- Public Attributes inherited from ConnectionManager
int backlog
 
int int backlog
 
int bool for_broadcast = false)
 
int port
 
int timeout_ms
 
int int timeout_ms
 

Detailed Description

This flavor of ConnectionManager will queue up all of the reset-connection messages from the ConnectionReaders and ConnectionWriters and report them to the client on demand.

When a reset connection has been discovered via reset_connection_available()/get_reset_connection(), it is still the responsibility of the client to call close_connection() on that connection to free up its resources.

Definition at line 39 of file queuedConnectionManager.h.

Member Function Documentation

bool QueuedConnectionManager::get_reset_connection ( PT(Connection)&  connection)

If a previous call to reset_connection_available() returned true, this function will return information about the newly reset connection.

Only connections which were externally reset are certain to appear in this list. Those which were explicitly closed via a call to close_connection() may or may not be reported. Furthermore, it is the responsibility of the caller to subsequently call close_connection() with any connection reported reset by this call. (There is no harm in calling close_connection() more than once on a given socket.)

The return value is true if a connection was successfully returned, or false if there was, in fact, no reset connection. (This may happen if there are multiple threads accessing the QueuedConnectionManager).

Definition at line 82 of file queuedConnectionManager.cxx.

Referenced by MayaToEggServer::poll().

bool QueuedConnectionManager::reset_connection_available ( ) const

Returns true if one of the readers/writers/listeners reported a connection reset recently.

If so, the particular connection that has been reset can be extracted via get_reset_connection().

Only connections which were externally reset are certain to appear in this list. Those which were explicitly closed via a call to close_connection() may or may not be reported. Furthermore, it is the responsibility of the caller to subsequently call close_connection() with any connection reported reset by this call. (There is no harm in calling close_connection() more than once on a given socket.)

Definition at line 55 of file queuedConnectionManager.cxx.

Referenced by MayaToEggServer::poll().


The documentation for this class was generated from the following files: