Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions
DatagramGeneratorNet Class Reference

This class provides datagrams one-at-a-time as read directly from the net, via a TCP connection. More...

Inheritance diagram for DatagramGeneratorNet:
DatagramGenerator ConnectionReader QueuedReturnDatagram

List of all members.

Public Member Functions

 DatagramGeneratorNet (ConnectionManager manager, int num_threads)
 Creates a new DatagramGeneratorNet with the indicated number of threads to handle requests.
bool getDatagram (Datagram data)
 Reads the next datagram from the stream.
bool isEof ()
 Returns true if the stream has been closed normally.
bool isError ()
 Returns true if the stream has an error condition.

Detailed Description

This class provides datagrams one-at-a-time as read directly from the net, via a TCP connection.

If a datagram is not available, get_datagram() will block until one is.


Constructor & Destructor Documentation

DatagramGeneratorNet ( ConnectionManager  manager,
int  num_threads 
)

Creates a new DatagramGeneratorNet with the indicated number of threads to handle requests.

Normally num_threads should be either 0 or 1 to guarantee that datagrams are generated in the same order in which they were received.


Member Function Documentation

bool getDatagram ( Datagram  data)

Reads the next datagram from the stream.

Blocks until a datagram is available. Returns true on success, false on stream closed or error.

Reimplemented from DatagramGenerator.

bool isEof ( )

Returns true if the stream has been closed normally.

This test may only be made after a call to get_datagram() has failed.

Reimplemented from DatagramGenerator.

bool isError ( )

Returns true if the stream has an error condition.

Reimplemented from DatagramGenerator.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties