Panda3D
|
This flavor of ConnectionListener will queue up all of the TCP connections it established for later detection by the client code. More...
#include "queuedConnectionListener.h"
Public Member Functions | |
QueuedConnectionListener (ConnectionManager *manager, int num_threads) | |
bool | get_new_connection (PT(Connection)&rendezvous, NetAddress &address, PT(Connection)&new_connection) |
If a previous call to new_connection_available() returned true, this function will return information about the newly established connection. | |
bool | get_new_connection (PT(Connection)&new_connection) |
This flavor of get_new_connection() simply returns a new connection, assuming the user doesn't care about the rendezvous socket that originated it or the address it came from. | |
bool | new_connection_available () |
Returns true if a new connection was recently established; the connection information may then be retrieved via get_new_connection(). | |
Protected Member Functions | |
virtual void | connection_opened (const PT(Connection)&rendezvous, const NetAddress &address, const PT(Connection)&new_connection) |
An internal function called by ConnectionListener() when a new TCP connection has been established. |
This flavor of ConnectionListener will queue up all of the TCP connections it established for later detection by the client code.
Definition at line 48 of file queuedConnectionListener.h.
void QueuedConnectionListener::connection_opened | ( | const PT(Connection)& | rendezvous, |
const NetAddress & | address, | ||
const PT(Connection)& | new_connection | ||
) | [protected, virtual] |
An internal function called by ConnectionListener() when a new TCP connection has been established.
The QueuedConnectionListener simply queues up this fact for later retrieval by get_new_connection().
Implements ConnectionListener.
Definition at line 115 of file queuedConnectionListener.cxx.
References QueuedReturn< ConnectionListenerData >::enqueue_thing().
bool QueuedConnectionListener::get_new_connection | ( | PT(Connection)& | rendezvous, |
NetAddress & | address, | ||
PT(Connection)& | new_connection | ||
) |
If a previous call to new_connection_available() returned true, this function will return information about the newly established connection.
The rendezvous parameter is the particular rendezvous socket this new connection originally communicated with; it is provided in case the ConnectionListener was monitorind more than one and you care which one it was. The address parameter is the net address of the new client, and new_connection is the socket of the newly established connection.
The return value is true if a connection was successfully returned, or false if there was, in fact, no new connection. (This may happen if there are multiple threads accessing the QueuedConnectionListener).
Definition at line 76 of file queuedConnectionListener.cxx.
References QueuedReturn< ConnectionListenerData >::get_thing().
Referenced by get_new_connection(), and MayaToEggServer::poll().
bool QueuedConnectionListener::get_new_connection | ( | PT(Connection)& | new_connection | ) |
This flavor of get_new_connection() simply returns a new connection, assuming the user doesn't care about the rendezvous socket that originated it or the address it came from.
Definition at line 99 of file queuedConnectionListener.cxx.
References get_new_connection().
Returns true if a new connection was recently established; the connection information may then be retrieved via get_new_connection().
Definition at line 49 of file queuedConnectionListener.cxx.
References ConnectionReader::poll(), and QueuedReturn< ConnectionListenerData >::thing_available().
Referenced by MayaToEggServer::poll().