Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL: TNL::PacketStream Class Reference

# TNL::PacketStream Class Reference

`#include <tnlBitStream.h>`

Inheritance diagram for TNL::PacketStream:

## Detailed Description

PacketStream provides a network interface to the BitStream for easy construction of data packets.

## Public Member Functions

| PacketStream (U32 targetPacketSize=MaxPacketDataSize)
| Constructor assigns the internal buffer to the BitStream.
NetError | sendto (Socket &outgoingSocket, const Address &theAddress)
| Sends this packet to the specified address through the specified socket.
NetError | recvfrom (Socket &incomingSocket, Address *recvAddress)
| Reads a packet into the stream from the specified socket.

## Private Types

typedef BitStream | Parent

## Private Attributes

U8 | buffer [MaxPacketDataSize]
| internal buffer for packet data, sized to the maximum UDP packet size.

## Member Typedef Documentation

typedef BitStream TNL::PacketStream::Parent`[private]`

## Constructor & Destructor Documentation

TNL::PacketStream::PacketStream | ( | U32 | targetPacketSize = `MaxPacketDataSize` | ) | `[inline]`

Constructor assigns the internal buffer to the BitStream.

## Member Function Documentation

NetError TNL::PacketStream::sendto | ( | Socket & | outgoingSocket,
|  | const Address & | theAddress |
| ) |  |  |

Sends this packet to the specified address through the specified socket.

NetError TNL::PacketStream::recvfrom | ( | Socket & | incomingSocket,
|  | Address * | recvAddress |
| ) |  |  |

Reads a packet into the stream from the specified socket.

## Field Documentation

U8 TNL::PacketStream::buffer[MaxPacketDataSize]`[private]`

internal buffer for packet data, sized to the maximum UDP packet size.