HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_NetPacket Class Reference

#include <UT_NetPacket.h>

Public Types

enum  { PacketCompress = 0x01, PacketCrypt = 0x02 }
 

Public Member Functions

 UT_NetPacket (unsigned write_bufsize=4096, unsigned read_bufsize=0)
 
 ~UT_NetPacket ()
 
int64 getMemoryUsage (bool inclusive) const
 
int writeData (UT_NetSocket &sock, const void *data, unsigned len)
 
int writeData (UT_NetSocket &sock, const char *data)
 
int flush (UT_NetSocket &sock)
 
int readPacketLength (UT_NetSocket &sock, int *timeout_ms=NULL)
 
int readPacketLength (UT_NetSocket &sock, int *timeout_ms, int &status)
 
int readPacketData (UT_NetSocket &sock, void *buf, unsigned len, int *timeout_ms=NULL)
 
int readPacketData (UT_NetSocket &sock, UT_WorkBuffer &buf, unsigned int len, int *timeout_ms=NULL)
 
int readPacketData (UT_NetSocket &sock, void *buf, unsigned len, int *timeout_ms, int &status)
 
int readPacketData (UT_NetSocket &sock, UT_WorkBuffer &buf, unsigned int len, int *timeout_ms, int &status)
 
voidreadPacket (UT_NetSocket &sock, unsigned &len, int timeout_ms, int &status)
 
voidreadPacket (UT_NetSocket &sock, unsigned &len, int timeout_ms=-1)
 
unsigned readPacket (UT_NetSocket &sock, void *data, unsigned size, int timeout_ms, int &status)
 
unsigned readPacket (UT_NetSocket &sock, void *data, unsigned size, int timeout_ms=-1)
 
unsigned readPacket (UT_NetSocket &sock, UT_WorkBuffer &wbuf, int timeout_ms=-1)
 
unsigned readPacket (UT_NetSocket &sock, UT_WorkBuffer &wbuf, int timeout_ms, int &status)
 
void setFlag (unsigned flag)
 
void clearFlag (unsigned flag)
 
int getFlag (unsigned flag) const
 
unsigned getDataSize () const
 
void limitDataSize (unsigned maxsize=4096)
 
voidsteal ()
 

Static Public Member Functions

static UT_NetSocketacceptClient (UT_NetSocket &server, int blocking=1, int timeout=10)
 
static const char * getHost ()
 
static const char * getUserHost ()
 
static int matchIPMask (const char *mask, const char *address, UT_NetSocket *socket)
 
static bool matchServerClientIPs (const unsigned short server[4], const unsigned short client[4], const char *mask_pattern)
 
static UT_NetSocketconnectToServer (const char *host=0, int port=-1, int blocking=1, int timeout=5, int forcesocket=0)
 
static int getDefaultServerPort ()
 
static void disconnectFromServer (UT_NetSocket *socket)
 

Detailed Description

Definition at line 29 of file UT_NetPacket.h.

Member Enumeration Documentation

anonymous enum
Enumerator
PacketCompress 
PacketCrypt 

Definition at line 95 of file UT_NetPacket.h.

Constructor & Destructor Documentation

UT_NetPacket::UT_NetPacket ( unsigned  write_bufsize = 4096,
unsigned  read_bufsize = 0 
)
explicit
UT_NetPacket::~UT_NetPacket ( )

Member Function Documentation

static UT_NetSocket* UT_NetPacket::acceptClient ( UT_NetSocket server,
int  blocking = 1,
int  timeout = 10 
)
static
void UT_NetPacket::clearFlag ( unsigned  flag)
inline

Definition at line 194 of file UT_NetPacket.h.

static UT_NetSocket* UT_NetPacket::connectToServer ( const char *  host = 0,
int  port = -1,
int  blocking = 1,
int  timeout = 5,
int  forcesocket = 0 
)
static
static void UT_NetPacket::disconnectFromServer ( UT_NetSocket socket)
static
int UT_NetPacket::flush ( UT_NetSocket sock)
unsigned UT_NetPacket::getDataSize ( ) const
inline

Definition at line 197 of file UT_NetPacket.h.

static int UT_NetPacket::getDefaultServerPort ( )
static
int UT_NetPacket::getFlag ( unsigned  flag) const
inline

Definition at line 195 of file UT_NetPacket.h.

static const char* UT_NetPacket::getHost ( )
static
int64 UT_NetPacket::getMemoryUsage ( bool  inclusive) const
static const char* UT_NetPacket::getUserHost ( )
static
void UT_NetPacket::limitDataSize ( unsigned  maxsize = 4096)
inline

Definition at line 198 of file UT_NetPacket.h.

static int UT_NetPacket::matchIPMask ( const char *  mask,
const char *  address,
UT_NetSocket socket 
)
static
static bool UT_NetPacket::matchServerClientIPs ( const unsigned short  server[4],
const unsigned short  client[4],
const char *  mask_pattern 
)
static
void* UT_NetPacket::readPacket ( UT_NetSocket sock,
unsigned &  len,
int  timeout_ms,
int status 
)
inline

Definition at line 139 of file UT_NetPacket.h.

void* UT_NetPacket::readPacket ( UT_NetSocket sock,
unsigned &  len,
int  timeout_ms = -1 
)
inline

Definition at line 153 of file UT_NetPacket.h.

unsigned UT_NetPacket::readPacket ( UT_NetSocket sock,
void data,
unsigned  size,
int  timeout_ms,
int status 
)
inline

Definition at line 164 of file UT_NetPacket.h.

unsigned UT_NetPacket::readPacket ( UT_NetSocket sock,
void data,
unsigned  size,
int  timeout_ms = -1 
)
inline

Definition at line 178 of file UT_NetPacket.h.

unsigned UT_NetPacket::readPacket ( UT_NetSocket sock,
UT_WorkBuffer wbuf,
int  timeout_ms = -1 
)
unsigned UT_NetPacket::readPacket ( UT_NetSocket sock,
UT_WorkBuffer wbuf,
int  timeout_ms,
int status 
)
int UT_NetPacket::readPacketData ( UT_NetSocket sock,
void buf,
unsigned  len,
int timeout_ms = NULL 
)
int UT_NetPacket::readPacketData ( UT_NetSocket sock,
UT_WorkBuffer buf,
unsigned int  len,
int timeout_ms = NULL 
)
int UT_NetPacket::readPacketData ( UT_NetSocket sock,
void buf,
unsigned  len,
int timeout_ms,
int status 
)
int UT_NetPacket::readPacketData ( UT_NetSocket sock,
UT_WorkBuffer buf,
unsigned int  len,
int timeout_ms,
int status 
)
int UT_NetPacket::readPacketLength ( UT_NetSocket sock,
int timeout_ms = NULL 
)
int UT_NetPacket::readPacketLength ( UT_NetSocket sock,
int timeout_ms,
int status 
)
void UT_NetPacket::setFlag ( unsigned  flag)
inline

Definition at line 193 of file UT_NetPacket.h.

void* UT_NetPacket::steal ( )
inline

Definition at line 203 of file UT_NetPacket.h.

int UT_NetPacket::writeData ( UT_NetSocket sock,
const void data,
unsigned  len 
)
int UT_NetPacket::writeData ( UT_NetSocket sock,
const char *  data 
)
inline

Definition at line 105 of file UT_NetPacket.h.


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