Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# DatagramSinkNet Class Reference

This class accepts datagrams one-at-a-time and sends them over the net, via a TCP connection. More...

Inheritance diagram for DatagramSinkNet:

List of all members.

## Public Member Functions
| DatagramSinkNet (ConnectionManager manager, int num_threads)
| Creates a new DatagramSinkNet with the indicated number of threads to handle writing.
| flush ()
| Ensures that all datagrams previously written will be visible on the stream.
Connection | getTarget ()
| Returns the current target Connection, or NULL if the target has not yet been set.
bool | isError ()
| Returns true if there is an error on the target connection, or if the target has never been set.
bool | putDatagram (Datagram const data)
| Sends the given datagram to the target.
| setTarget (Connection connection)
| Specifies the Connection that will receive all future Datagrams sent.

## Detailed Description

This class accepts datagrams one-at-a-time and sends them over the net, via a TCP connection.

## Constructor & Destructor Documentation

DatagramSinkNet | ( | ConnectionManager | manager,
|  | int | num_threads
| ) |  |

Creates a new DatagramSinkNet with the indicated number of threads to handle writing.

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

## Member Function Documentation

flush | ( |  | ) |

Ensures that all datagrams previously written will be visible on the stream.

Reimplemented from DatagramSink.

Connection getTarget | ( |  | ) |

Returns the current target Connection, or NULL if the target has not yet been set.

See set_target().

bool isError | ( |  | ) |

Returns true if there is an error on the target connection, or if the target has never been set.

Reimplemented from DatagramSink.

bool putDatagram | ( | Datagram const | data | ) |

Sends the given datagram to the target.

Returns true on success, false if there is an error. Blocks if necessary until the target is ready.

Reimplemented from DatagramSink.

setTarget | ( | Connection | connection | ) |

Specifies the Connection that will receive all future Datagrams sent.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties