ArNetworking: ArNetPacket Class Reference

- Main Page
- Classes
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArNetPacket Class Reference

`#include <ArNetPacket.h>`

Inheritance diagram for ArNetPacket:

List of all members.

## Detailed Description

our packet for the network stuff

## Public Types
enum | { SIZE_OF_LENGTH = 2, MAX_LENGTH = 32000, HEADER_LENGTH = 6, FOOTER_LENGTH = 2, MAX_DATA_LENGTH = MAX_LENGTH - HEADER_LENGTH - FOOTER_LENGTH - SIZE_OF_LENGTH }
enum | PacketSource { TCP, UDP }
| an enum for where the packet came from More...
## Public Member Functions
| ArNetPacket (const ArNetPacket &other)
| Copy constructor.
| ArNetPacket (ArTypes::UByte2 bufferSize=ArNetPacket::MAX_LENGTH+5)
| Constructor.
virtual double | bufToDouble (void)
| Gets a double from the packet buffer.
ArTypes::Byte2 | calcCheckSum (void)
| returns the checksum, probably used only internally
virtual void | doubleToBuf (double val)
| Puts a double into the packet buffer.
virtual void | duplicatePacket (ArNetPacket *packet)
virtual void | empty (void)
virtual void | finalizePacket (void)
bool | getAddedFooter (void)
| Iternal function that sets if we already added the footer(for forwarding).
const char * | getArbitraryString (void)
ArTypes::UByte2 | getCommand (void)
| Gets the command this packet is.
PacketSource | getPacketSource (void)
ArNetPacket & | operator= (const ArNetPacket &other)
| Assignment operator.
virtual void | resetRead (void)
void | setAddedFooter (bool addedFooter)
| Iternal function that sets if we already added the footer(for forwarding).
void | setArbitraryString (const char *string)
void | setCommand (ArTypes::UByte2 command)
| Sets the command this packet is.
void | setPacketSource (PacketSource source)
bool | verifyCheckSum (void)
| returns true if the checksum matches what it should be
virtual | ~ArNetPacket ()
| Destructor.
## Protected Attributes
bool | myAddedFooter
std::string | myArbitraryString
ArTypes::UByte2 | myCommand
PacketSource | myPacketSource

## Member Enumeration Documentation

anonymous enum

Enumerator:

  SIZE_OF_LENGTH | Number of bytes needed to store packet length value.
  MAX_LENGTH | Suggested maximum total size of a packet (bytes).
  HEADER_LENGTH | Bytes of packet data used for header.
  FOOTER_LENGTH | Byset of packet data used for footer.
  MAX_DATA_LENGTH | Suggested maximum size for data payload (this is the total suggested packet size minus headers and footers)

enum ArNetPacket::PacketSource

an enum for where the packet came from

Enumerator:

  TCP | Came in over tcp.
  UDP | Came in over udp.

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

- ArNetPacket.h