XPAddress Struct Reference

#include <XPSocket.h>

List of all members.

Public Member Functions

 XPAddress (const int port, unsigned char addr1, unsigned char addr2, unsigned char addr3, unsigned char addr4)
 XPAddress (const int port)
 XPAddress (std::string addr)
 XPAddress ()
std::string Export (void) const
bool Import (const std::string address)
void MakeAny (const int port=XPSOCK_PORT_ANY)

Static Public Member Functions

static XPAddress Null (void)

Public Attributes

int port
unsigned char addr [4]


Detailed Description

This is an address that the sockets use

Constructor & Destructor Documentation

XPAddress ( const int  port,
unsigned char  addr1,
unsigned char  addr2,
unsigned char  addr3,
unsigned char  addr4 
)

ctor for XPAddress that allows the structure to be constructed in a C++ fashion

XPAddress ( const int  port  ) 

ctor for XPAddress that allows the structure to be constructed in a C++ fashion. The address component is initialised to be any incoming address.

XPAddress ( std::string  addr  ) 

ctor that accepts a std::string in the form xx.xx.xx.xx:xx and converts it to an address

XPAddress (  ) 

default ctor, all members are not initialised.


Member Function Documentation

std::string Export ( void   )  const

Exports the XPAddress as a std::string

Returns:
returns the std::string version of this XPAddress

bool Import ( const std::string  address  ) 

Imports a string in x.x.x.x:x format as an IP address and port number.

Parameters:
address The address in x.x.x.x:x format.
Returns:
true is a cussful import, false indicates there was a formatting error within the string.

void MakeAny ( const int  port = XPSOCK_PORT_ANY  ) 

Sets this address to be for any incoming address with an optional port number.

XPAddress Null ( void   )  [static]

Returns:
Returns XPAddress(0,0,0,0,0)


Member Data Documentation

int port

The port number for this address

unsigned char addr[4]

The IP addr for this structure


Generated on Sat Jun 28 22:02:28 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3