Panda3D
Classes | Public Member Functions | List of all members
PStatReader Class Reference

This is the class that does all the work for handling communications from a single Panda client. More...

#include "pStatReader.h"

Inheritance diagram for PStatReader:
ConnectionReader

Public Member Functions

 PStatReader (PStatServer *manager, PStatMonitor *monitor)
 
void close ()
 This will be called by the PStatClientData in response to its close() call. More...
 
PStatMonitorget_monitor ()
 Returns the monitor that this reader serves. More...
 
void idle ()
 Called each frame to do what needs to be done for the monitor's user- defined idle routines. More...
 
void lost_connection ()
 This is called by the PStatServer when it detects that the connection has been lost. More...
 
void set_tcp_connection (Connection *tcp_connection)
 This is intended to be called only once, immediately after construction, by the PStatListener that created it. More...
 
- Public Member Functions inherited from ConnectionReader
 ConnectionReader (ConnectionManager *manager, int num_threads, const std::string &thread_name=std::string())
 Creates a new ConnectionReader with the indicated number of threads to handle requests. More...
 
bool add_connection (Connection *connection)
 Adds a new socket to the list of sockets the ConnectionReader will monitor. More...
 
ConnectionManagerget_manager () const
 Returns a pointer to the ConnectionManager object that serves this ConnectionReader. More...
 
int get_num_threads () const
 Returns the number of threads the ConnectionReader has been created with. More...
 
bool get_raw_mode () const
 Returns the current setting of the raw mode flag. More...
 
int get_tcp_header_size () const
 Returns the current setting of TCP header size. More...
 
bool is_connection_ok (Connection *connection)
 Returns true if the indicated connection has been added to the ConnectionReader and is being monitored properly, false if it is not known, or if there was some error condition detected on the connection. More...
 
bool is_polling () const
 Returns true if the reader is a polling reader, i.e. More...
 
void poll ()
 Explicitly polls the available sockets to see if any of them have any noise. More...
 
bool remove_connection (Connection *connection)
 Removes a socket from the list of sockets being monitored. More...
 
void set_raw_mode (bool mode)
 Sets the ConnectionReader into raw mode (or turns off raw mode). More...
 
void set_tcp_header_size (int tcp_header_size)
 Sets the header size of TCP packets. More...
 
void shutdown ()
 Terminates all threads cleanly. More...
 

Detailed Description

This is the class that does all the work for handling communications from a single Panda client.

It reads sockets received from the client and boils them down into PStatData.

Definition at line 41 of file pStatReader.h.

Member Function Documentation

◆ close()

void PStatReader::close ( )

This will be called by the PStatClientData in response to its close() call.

It will tell the server to let go of the reader so it can shut down its connection.

Definition at line 61 of file pStatReader.cxx.

References lost_connection(), and PStatServer::remove_reader().

Referenced by PStatClientData::close().

◆ get_monitor()

PStatMonitor * PStatReader::get_monitor ( )

Returns the monitor that this reader serves.

Definition at line 119 of file pStatReader.cxx.

◆ idle()

void PStatReader::idle ( )

Called each frame to do what needs to be done for the monitor's user- defined idle routines.

Definition at line 110 of file pStatReader.cxx.

Referenced by PStatServer::poll().

◆ lost_connection()

void PStatReader::lost_connection ( )

This is called by the PStatServer when it detects that the connection has been lost.

It should clean itself up and shut down nicely.

Definition at line 94 of file pStatReader.cxx.

Referenced by close(), and PStatServer::poll().

◆ set_tcp_connection()

void PStatReader::set_tcp_connection ( Connection tcp_connection)

This is intended to be called only once, immediately after construction, by the PStatListener that created it.

It tells the reader about the newly- established TCP connection to a client.

Definition at line 72 of file pStatReader.cxx.

References ConnectionReader::add_connection(), and PStatServer::get_udp_port().


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