Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

network
Struct CSocketAddress

   in SocketBase.h
   in SocketBase.cpp

struct CSocketAddress

A protocol-independent representation of a socket address. All protocols in the ESocketProtocol enum should have a corresponding member in this union.


Inner Classes, Typedefs, and Enums
union CSocketAddress::anonymous_union_1
          
 
Field Summary
 CSocketAddress::anonymous_union_1 m_Union
          
 
Constructor Summary
inline CSocketAddress()
          
CSocketAddress( u8 address[ 4], int port )
          Create an address from a numerical IPv4 address and port, port in local byte order, IPv4 address as a byte array in written order.
explicit CSocketAddress( int port, ESocketProtocol proto = IPv4 )
          Create a wildcard address for the specified protocol with a specified port.
 
Method Summary
 int GetPort() const
          Returns the port number part of the address
 inline ESocketProtocol GetProtocol() const
          
 CStr GetString() const
          Returns the string representation of the address, i.
 static CSocketAddress Loopback( int port, ESocketProtocol proto = IPv4 )
          
 static PS_RESULT Resolve( const char* name, int port, CSocketAddress& addr )
          Resolve the name using the system name resolution service (i.e. DNS) and store the resulting address.
 

Field Detail

m_Union

public CSocketAddress::anonymous_union_1 m_Union;


Constructor Detail

CSocketAddress

public inline CSocketAddress();

CSocketAddress

public CSocketAddress( u8 address[ 4], int port );
Create an address from a numerical IPv4 address and port, port in local byte order, IPv4 address as a byte array in written order. The Protocol of the resulting SocketAddress will be IPv4
Parameters:
address - An IPv4 address as a byte array (in written order)
port - A port number (0-65535) in local byte order.

CSocketAddress

public explicit CSocketAddress( int port, ESocketProtocol proto = IPv4 );
Create a wildcard address for the specified protocol with a specified port.
Parameters:
port - The port number, in local byte order
proto - The protocol to use; default IPv4


Method Detail

GetPort

public int GetPort() const;
Returns the port number part of the address

GetProtocol

public inline ESocketProtocol GetProtocol() const;

GetString

public CStr GetString() const;
Returns the string representation of the address, i.e. the IP (v4 or v6) address. Note that the port is not included in the string (mostly due to the fact that the port representation differs wildly between address families, and that Resolve does not take port as part of the hostname)

Loopback

public static CSocketAddress Loopback( int port, ESocketProtocol proto = IPv4 );

Resolve

public static PS_RESULT Resolve( const char* name, int port, CSocketAddress& addr );
Resolve the name using the system name resolution service (i.e. DNS) and store the resulting address. When multiple addresses are found, the first result is returned. Note that this call will block until the name resolution attempt is either completed successfully or timed out.
Parameters:
name - The name to resolve
addr - A reference to the variable to hold the address
Returns:
The result of the operation

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:13
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD