Panda3D
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
const Interfaceget_interface (size_t n)
 
size_t get_num_interfaces ()
 
 PT (Connection) open_UDP_connection(uint16_t port=0)
 
 PT (Connection) open_TCP_client_connection(const NetAddress &address
 
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
 Returns the current number of things in the queue. More...
 
int get_max_queue_size () const
 Returns the maximum size the queue is allowed to grow to. More...
 
bool get_overflow_flag () const
 Returns true if the queue has overflowed since the last call to reset_overflow_flag() (implying that some elements have been dropped from the queue), or false otherwise. More...
 
void reset_overflow_flag ()
 Resets the overflow flag so that get_overflow_flag() will return false until a new overflow occurs. More...
 
void set_max_queue_size (int max_size)
 Sets the maximum size the queue is allowed to grow to. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ConnectionManager
static std::string get_host_name ()
 
- Public Attributes inherited from ConnectionManager
PT(Connection) open_UDP_connection(const std int backlog
 
PT(Connection) open_TCP_server_rendezvous(const std int backlog
 
 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...
 
 get_interface
 Returns the nth usable network interface detected on this machine. More...
 
 get_num_interfaces
 This returns the number of usable network interfaces detected on this machine. More...
 
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 35 of file queuedConnectionManager.h.

Member Function Documentation

◆ get_reset_connection()

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 67 of file queuedConnectionManager.cxx.

Referenced by MayaToEggServer::poll().

◆ reset_connection_available()

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 47 of file queuedConnectionManager.cxx.

Referenced by MayaToEggServer::poll().


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