DatagramGeneratorNet

from panda3d.core import DatagramGeneratorNet
class DatagramGeneratorNet

Bases:

Bases: DatagramGenerator, ConnectionReader, QueuedReturn_Datagram

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.

Inheritance diagram

Inheritance diagram of DatagramGeneratorNet

__init__(manager: ConnectionManager, num_threads: int)

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.

get_datagram(data: Datagram) bool

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

is_eof() bool

Returns true if the stream has been closed normally. This test may only be made after a call to get_datagram() has failed.

is_error() bool

Returns true if the stream has an error condition.