Panda3D
|
A specific kind of Datagram, especially for sending across or receiving from a network. More...
#include "netDatagram.h"
Public Member Functions | |
NetDatagram () | |
Constructs an empty datagram. | |
NetDatagram (const void *data, size_t size) | |
Constructs a datagram from an existing block of data. | |
NetDatagram (const NetDatagram ©) | |
NetDatagram (const Datagram ©) | |
virtual void | clear () |
Resets the datagram to empty, in preparation for building up a new datagram. | |
virtual TypeHandle | force_init_type () |
const NetAddress & | get_address () const |
Retrieves the host from which the datagram was read, or to which it is scheduled to be sent. | |
virtual TypeHandle | get_type () const |
bool | operator!= (const NetDatagram &other) const |
bool | operator< (const NetDatagram &other) const |
void | operator= (const Datagram ©) |
void | operator= (const NetDatagram ©) |
bool | operator== (const NetDatagram &other) const |
PT (Connection) get_connection() const | |
void | set_address (const NetAddress &address) |
Specifies the host to which the datagram should be sent. | |
void | set_connection (const PT(Connection)&connection) |
Specifies the socket to which the datagram should be written. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. |
A specific kind of Datagram, especially for sending across or receiving from a network.
It's different only in that it knows which Connection and/or NetAddress it is to be sent to or was received from.
Definition at line 43 of file netDatagram.h.
NetDatagram::NetDatagram | ( | ) |
Constructs an empty datagram.
Definition at line 25 of file netDatagram.cxx.
NetDatagram::NetDatagram | ( | const void * | data, |
size_t | size | ||
) |
Constructs a datagram from an existing block of data.
Definition at line 34 of file netDatagram.cxx.
void NetDatagram::clear | ( | ) | [virtual] |
Resets the datagram to empty, in preparation for building up a new datagram.
Reimplemented from Datagram.
Definition at line 93 of file netDatagram.cxx.
References NetAddress::clear().
Referenced by DatagramQueue::extract().
const NetAddress & NetDatagram::get_address | ( | ) | const |
Retrieves the host from which the datagram was read, or to which it is scheduled to be sent.
Definition at line 139 of file netDatagram.cxx.
static void NetDatagram::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from Datagram.
Definition at line 77 of file netDatagram.h.
References Datagram::init_type().
void NetDatagram::set_address | ( | const NetAddress & | address | ) |
Specifies the host to which the datagram should be sent.
Definition at line 128 of file netDatagram.cxx.
Referenced by ConnectionWriter::send().
void NetDatagram::set_connection | ( | const PT(Connection)& | connection | ) |
Specifies the socket to which the datagram should be written.
Definition at line 106 of file netDatagram.cxx.
Referenced by ConnectionWriter::send().