Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
UDP Class Reference

#include <udp.h>

Public Types

enum  sockStat {
  OK = 0 , UNKNOWN = -1 , ISCONN = -2 , INPROGRESS = -3 ,
  ALREADY = -4 , AGAIN = -5 , ADDRINUSE = -6 , ADDRNOTAVAIL = -7 ,
  BADF = -8 , CONNREFUSED = -9 , INTR =-10 , NOTSOCK =-11 ,
  PIPE =-12 , WOULDBLOCK =-13 , INVAL =-14 , TIMEDOUT =-15 ,
  OK = 0 , UNKNOWN = -1 , ISCONN = -2 , INPROGRESS = -3 ,
  ALREADY = -4 , AGAIN = -5 , ADDRINUSE = -6 , ADDRNOTAVAIL = -7 ,
  BADF = -8 , CONNREFUSED = -9 , INTR =-10 , NOTSOCK =-11 ,
  PIPE =-12 , WOULDBLOCK =-13 , INVAL =-14 , TIMEDOUT =-15 ,
  OK = 0 , UNKNOWN = -1 , ISCONN = -2 , INPROGRESS = -3 ,
  ALREADY = -4 , AGAIN = -5 , ADDRINUSE = -6 , ADDRNOTAVAIL = -7 ,
  BADF = -8 , CONNREFUSED = -9 , INTR =-10 , NOTSOCK =-11 ,
  PIPE =-12 , WOULDBLOCK =-13 , INVAL =-14 , TIMEDOUT =-15
}
 

Public Member Functions

 UDP ()
 
 ~UDP ()
 
Int Bind (UnsignedInt IP, UnsignedShort port)
 
Int Bind (const char *Host, UnsignedShort port)
 
Int Write (const unsigned char *msg, UnsignedInt len, UnsignedInt IP, UnsignedShort port)
 
Int Read (unsigned char *msg, UnsignedInt len, sockaddr_in *from)
 
sockStat GetStatus (void)
 
void ClearStatus (void)
 
Int getLocalAddr (UnsignedInt &ip, UnsignedShort &port)
 
Int getFD (void)
 
Int SetInputBuffer (UnsignedInt bytes)
 
Int SetOutputBuffer (UnsignedInt bytes)
 
int GetInputBuffer (void)
 
int GetOutputBuffer (void)
 
Int AllowBroadcasts (Bool status)
 
 UDP ()
 
 ~UDP ()
 
sint32 Bind (uint32 IP, uint16 port)
 
sint32 Bind (char *Host, uint16 port)
 
sint32 Write (uint8 *msg, uint32 len, uint32 IP, uint16 port)
 
sint32 Read (uint8 *msg, uint32 len, sockaddr_in *from)
 
sockStat GetStatus (void)
 
void ClearStatus (void)
 
int Wait (sint32 sec, sint32 usec, fd_set &returnSet)
 
int Wait (sint32 sec, sint32 usec, fd_set &givenSet, fd_set &returnSet)
 
bit8 getLocalAddr (uint32 &ip, uint16 &port)
 
sint32 getFD (void)
 
bit8 SetInputBuffer (uint32 bytes)
 
bit8 SetOutputBuffer (uint32 bytes)
 
int GetInputBuffer (void)
 
int GetOutputBuffer (void)
 
 UDP ()
 
 ~UDP ()
 
sint32 Bind (uint32 IP, uint16 port)
 
sint32 Bind (char *Host, uint16 port)
 
sint32 Write (uint8 *msg, uint32 len, uint32 IP, uint16 port)
 
sint32 Read (uint8 *msg, uint32 len, sockaddr_in *from)
 
sockStat GetStatus (void)
 
void ClearStatus (void)
 
int Wait (sint32 sec, sint32 usec, fd_set &returnSet)
 
int Wait (sint32 sec, sint32 usec, fd_set &givenSet, fd_set &returnSet)
 
bit8 getLocalAddr (uint32 &ip, uint16 &port)
 
sint32 getFD (void)
 
bit8 SetInputBuffer (uint32 bytes)
 
bit8 SetOutputBuffer (uint32 bytes)
 
int GetInputBuffer (void)
 
int GetOutputBuffer (void)
 

Detailed Description

Definition at line 65 of file udp.h.

Member Enumeration Documentation

◆ sockStat

Enumerator
OK 
UNKNOWN 
ISCONN 
INPROGRESS 
ALREADY 
AGAIN 
ADDRINUSE 
ADDRNOTAVAIL 
BADF 
CONNREFUSED 
INTR 
NOTSOCK 
PIPE 
WOULDBLOCK 
INVAL 
TIMEDOUT 
OK 
UNKNOWN 
ISCONN 
INPROGRESS 
ALREADY 
AGAIN 
ADDRINUSE 
ADDRNOTAVAIL 
BADF 
CONNREFUSED 
INTR 
NOTSOCK 
PIPE 
WOULDBLOCK 
INVAL 
TIMEDOUT 
OK 
UNKNOWN 
ISCONN 
INPROGRESS 
ALREADY 
AGAIN 
ADDRINUSE 
ADDRNOTAVAIL 
BADF 
CONNREFUSED 
INTR 
NOTSOCK 
PIPE 
WOULDBLOCK 
INVAL 
TIMEDOUT 

Definition at line 77 of file udp.h.

Constructor & Destructor Documentation

◆ UDP() [1/3]

UDP::UDP ( )

Definition at line 122 of file udp.cpp.

◆ ~UDP() [1/3]

UDP::~UDP ( )

Definition at line 127 of file udp.cpp.

◆ UDP() [2/3]

UDP::UDP ( )

◆ ~UDP() [2/3]

UDP::~UDP ( )

◆ UDP() [3/3]

UDP::UDP ( )

◆ ~UDP() [3/3]

UDP::~UDP ( )

Member Function Documentation

◆ AllowBroadcasts()

Int UDP::AllowBroadcasts ( Bool status)

Definition at line 504 of file udp.cpp.

◆ Bind() [1/6]

sint32 UDP::Bind ( char * Host,
uint16 port )

Definition at line 31 of file udp.cpp.

◆ Bind() [2/6]

sint32 UDP::Bind ( char * Host,
uint16 port )

◆ Bind() [3/6]

Int UDP::Bind ( const char * Host,
UnsignedShort port )

Definition at line 133 of file udp.cpp.

◆ Bind() [4/6]

sint32 UDP::Bind ( uint32 IP,
uint16 port )

Definition at line 51 of file udp.cpp.

◆ Bind() [5/6]

sint32 UDP::Bind ( uint32 IP,
uint16 port )

◆ Bind() [6/6]

Int UDP::Bind ( UnsignedInt IP,
UnsignedShort port )

Definition at line 153 of file udp.cpp.

◆ ClearStatus() [1/3]

void UDP::ClearStatus ( void )

Definition at line 321 of file udp.cpp.

◆ ClearStatus() [2/3]

void UDP::ClearStatus ( void )

◆ ClearStatus() [3/3]

void UDP::ClearStatus ( void )

◆ getFD() [1/3]

Int UDP::getFD ( void )
inline

Definition at line 118 of file udp.h.

◆ getFD() [2/3]

sint32 UDP::getFD ( void )
inline

Definition at line 106 of file udp.h.

◆ getFD() [3/3]

sint32 UDP::getFD ( void )
inline

Definition at line 106 of file udp.h.

◆ GetInputBuffer() [1/3]

int UDP::GetInputBuffer ( void )

Definition at line 485 of file udp.cpp.

◆ GetInputBuffer() [2/3]

int UDP::GetInputBuffer ( void )

◆ GetInputBuffer() [3/3]

int UDP::GetInputBuffer ( void )

◆ getLocalAddr() [1/3]

bit8 UDP::getLocalAddr ( uint32 & ip,
uint16 & port )

Definition at line 96 of file udp.cpp.

◆ getLocalAddr() [2/3]

bit8 UDP::getLocalAddr ( uint32 & ip,
uint16 & port )

◆ getLocalAddr() [3/3]

Int UDP::getLocalAddr ( UnsignedInt & ip,
UnsignedShort & port )

Definition at line 201 of file udp.cpp.

◆ GetOutputBuffer() [1/3]

int UDP::GetOutputBuffer ( void )

Definition at line 495 of file udp.cpp.

◆ GetOutputBuffer() [2/3]

int UDP::GetOutputBuffer ( void )

◆ GetOutputBuffer() [3/3]

int UDP::GetOutputBuffer ( void )

◆ GetStatus() [1/3]

UDP::sockStat UDP::GetStatus ( void )

Definition at line 330 of file udp.cpp.

◆ GetStatus() [2/3]

sockStat UDP::GetStatus ( void )

◆ GetStatus() [3/3]

sockStat UDP::GetStatus ( void )

◆ Read() [1/3]

sint32 UDP::Read ( uint8 * msg,
uint32 len,
sockaddr_in * from )

Definition at line 156 of file udp.cpp.

◆ Read() [2/3]

sint32 UDP::Read ( uint8 * msg,
uint32 len,
sockaddr_in * from )

◆ Read() [3/3]

Int UDP::Read ( unsigned char * msg,
UnsignedInt len,
sockaddr_in * from )

Definition at line 270 of file udp.cpp.

◆ SetInputBuffer() [1/3]

bit8 UDP::SetInputBuffer ( uint32 bytes)

Definition at line 311 of file udp.cpp.

◆ SetInputBuffer() [2/3]

bit8 UDP::SetInputBuffer ( uint32 bytes)

◆ SetInputBuffer() [3/3]

Int UDP::SetInputBuffer ( UnsignedInt bytes)

Definition at line 457 of file udp.cpp.

◆ SetOutputBuffer() [1/3]

bit8 UDP::SetOutputBuffer ( uint32 bytes)

Definition at line 329 of file udp.cpp.

◆ SetOutputBuffer() [2/3]

bit8 UDP::SetOutputBuffer ( uint32 bytes)

◆ SetOutputBuffer() [3/3]

Int UDP::SetOutputBuffer ( UnsignedInt bytes)

Definition at line 471 of file udp.cpp.

◆ Wait() [1/4]

int UDP::Wait ( sint32 sec,
sint32 usec,
fd_set & givenSet,
fd_set & returnSet )

DBGMSG("WAIT fd="<<fd<<" givenMax="<<givenMax);

DBGMSG("Wait retval: "<<retval);

Definition at line 240 of file udp.cpp.

◆ Wait() [2/4]

int UDP::Wait ( sint32 sec,
sint32 usec,
fd_set & givenSet,
fd_set & returnSet )

◆ Wait() [3/4]

int UDP::Wait ( sint32 sec,
sint32 usec,
fd_set & returnSet )

Definition at line 227 of file udp.cpp.

◆ Wait() [4/4]

int UDP::Wait ( sint32 sec,
sint32 usec,
fd_set & returnSet )

◆ Write() [1/3]

Int UDP::Write ( const unsigned char * msg,
UnsignedInt len,
UnsignedInt IP,
UnsignedShort port )

Definition at line 238 of file udp.cpp.

◆ Write() [2/3]

sint32 UDP::Write ( uint8 * msg,
uint32 len,
uint32 IP,
uint16 port )

Definition at line 133 of file udp.cpp.

◆ Write() [3/3]

sint32 UDP::Write ( uint8 * msg,
uint32 len,
uint32 IP,
uint16 port )

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