Panda3D
|
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...
Public Member Functions | |
__init__ () | |
bool | getResetConnection (PointerToConnection connection) |
If a previous call to reset_connection_available() returned true, this function will return information about the newly reset connection. More... | |
bool | resetConnectionAvailable () |
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(). More... | |
![]() | |
__init__ () | |
bool | closeConnection (Connection connection) |
Terminates a UDP or TCP socket previously opened. This also removes it from any associated ConnectionReader or ConnectionListeners. More... | |
const ConnectionManager::Interface | getInterface (int n) |
Returns the nth usable network interface detected on this machine. (Currently, only IPv4 interfaces are reported.) See scan_interfaces() to repopulate this list. More... | |
list | getInterfaces () |
int | getNumInterfaces () |
This returns the number of usable network interfaces detected on this machine. (Currently, only IPv4 interfaces are reported.) See scan_interfaces() to repopulate this list. More... | |
Connection | openTCPClientConnection (const NetAddress address, int timeout_ms) |
Attempts to establish a TCP client connection to a server at the indicated address. If the connection is not established within timeout_ms milliseconds, a null connection is returned. More... | |
Connection | openTCPClientConnection (str hostname, int port, int timeout_ms) |
This is a shorthand version of the function to directly establish communications to a named host and port. More... | |
Connection | openTCPServerRendezvous (const NetAddress address, int backlog) |
Creates a socket to be used as a rendezvous socket for a server to listen for TCP connections. The socket returned by this call should only be added to a ConnectionListener (not to a generic ConnectionReader). More... | |
Connection | openTCPServerRendezvous (int port, int backlog) |
Creates a socket to be used as a rendezvous socket for a server to listen for TCP connections. The socket returned by this call should only be added to a ConnectionListener (not to a generic ConnectionReader). More... | |
Connection | openTCPServerRendezvous (str hostname, int port, int backlog) |
Creates a socket to be used as a rendezvous socket for a server to listen for TCP connections. The socket returned by this call should only be added to a ConnectionListener (not to a generic ConnectionReader). More... | |
Connection | openUDPConnection (int port) |
Opens a socket for sending and/or receiving UDP packets. If the port number is greater than zero, the UDP connection will be opened for listening on the indicated port; otherwise, it will be useful only for sending. More... | |
Connection | openUDPConnection (str hostname, int port, bool for_broadcast) |
Opens a socket for sending and/or receiving UDP packets. If the port number is greater than zero, the UDP connection will be opened for listening on the indicated port; otherwise, it will be useful only for sending. More... | |
scanInterfaces () | |
Repopulates the list reported by get_num_interface()/get_interface(). It is not necessary to call this explicitly, unless you want to re-determine the connected interfaces (for instance, if you suspect the hardware has recently changed). More... | |
bool | waitForReaders (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. The return value is true if there is data available (but you have to iterate through all readers to find it), or false if the timeout occurred without any data. More... | |
![]() | |
int | getCurrentQueueSize () |
int | getMaxQueueSize () |
bool | getOverflowFlag () |
resetOverflowFlag () | |
setMaxQueueSize (int max_size) | |
Additional Inherited Members | |
![]() | |
static str | getHostName () |
Returns the name of this particular machine on the network, if available, or the empty string if the hostname cannot be determined. More... | |
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.
__init__ | ( | ) |
bool getResetConnection | ( | PointerToConnection | 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).
bool resetConnectionAvailable | ( | ) |
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.)