Panda3D
Public Member Functions | Protected Member Functions
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) >

List of all members.

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.
bool reset_connection_available () const
 Returns true if one of the readers/writers/listeners reported a connection reset recently.

Protected Member Functions

virtual void connection_reset (const PT(Connection)&connection, bool okflag)
 An internal function called by the ConnectionReader, ConnectionWriter, or ConnectionListener when a connection has been externally reset.

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

void QueuedConnectionManager::connection_reset ( const PT(Connection)&  connection,
bool  okflag 
) [protected, virtual]

An internal function called by the ConnectionReader, ConnectionWriter, or ConnectionListener when a connection has been externally reset.

This adds the connection to the queue of those which have recently been reset.

Reimplemented from ConnectionManager.

Definition at line 97 of file queuedConnectionManager.cxx.

References QueuedReturn< PT(Connection) >::enqueue_unique_thing().

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.

References QueuedReturn< PT(Connection) >::get_thing().

Referenced by MayaToEggServer::poll().

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.

References QueuedReturn< PT(Connection) >::thing_available().

Referenced by MayaToEggServer::poll().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations