#include <socket_name.h>
Public Member Functions | |
Construction | |
| CL_SocketName () | |
| Constructs a new socket name. | |
| CL_SocketName (const CL_String &port) | |
| Constructs a SocketName. | |
| CL_SocketName (const CL_String &address, const CL_String &port) | |
| Constructs a SocketName. | |
| CL_SocketName (const CL_SocketName ©) | |
| Constructs a SocketName. | |
Attributes | |
| CL_String | get_address () const |
| Returns the address part of the socket name. | |
| CL_String | get_port () const |
| Returns the port part of the socket name. | |
| bool | operator== (const CL_SocketName &other_instance) const |
| Returns true if objects are the same. | |
| bool | operator< (const CL_SocketName &other_instance) const |
| Returns true if the other address is less. | |
| bool | operator> (const CL_SocketName &other_instance) const |
| Returns true if the other address is greater. | |
Operations | |
| void | set_name (const CL_String &hostname, const CL_String &port) |
| Set the socket name using a hostname and port. | |
| void | set_address (const CL_String &address) |
| Set the IP address. | |
| void | set_port (const CL_String &port) |
| Set the IP port. | |
| CL_String | lookup_ipv4 () const |
| Perform a DNS lookup, if needed, for the IP v4 address. | |
| CL_String | lookup_hostname () const |
| Perform a DNS lookup, if needed, for the hostname. | |
| CL_SocketName | to_ipv4 () |
| Create socket name that uses the IP v4 address as its address. | |
| CL_SocketName | to_hostname () |
| Create socket name that uses the hostname as its address. | |
| void | to_sockaddr (int domain, struct sockaddr *addr, int len) const |
| Fill the socket name into a C sockets sockaddr structure. | |
| void | from_sockaddr (int domain, struct sockaddr *addr, int len) |
| Get the socket name from a C sockets sockaddr structure. | |
|
|
Constructs a new socket name. If no address is specified, the socket address will default to INADDR_ANY. If no port is specified, it will default to port 0. |
|
|
Constructs a SocketName.
|
|
||||||||||||
|
Constructs a SocketName.
|
|
|
Constructs a SocketName.
|
|
||||||||||||||||
|
Get the socket name from a C sockets sockaddr structure.
|
|
|
Returns the address part of the socket name.
|
|
|
Returns the port part of the socket name.
|
|
|
Perform a DNS lookup, if needed, for the hostname.
|
|
|
Perform a DNS lookup, if needed, for the IP v4 address.
|
|
|
Returns true if the other address is less. This is used for sorting purposes (eg. if you use a std::map<CL_SocketName, CL_Socket>), and sorts the address based on lowest IP number address. |
|
|
Returns true if objects are the same.
|
|
|
Returns true if the other address is greater. This is used for sorting purposes (eg. if you use a std::map<CL_SocketName, CL_Socket>), and sorts the address based on lowest IP number address. |
|
|
Set the IP address.
|
|
||||||||||||
|
Set the socket name using a hostname and port.
|
|
|
Set the IP port.
|
|
|
Create socket name that uses the hostname as its address.
|
|
|
Create socket name that uses the IP v4 address as its address.
|
|
||||||||||||||||
|
Fill the socket name into a C sockets sockaddr structure.
|
1.4.6