#include <MEM_Addr.h>
Inheritance diagram for ACE_MEM_Addr:
Public Member Functions | |
ACE_MEM_Addr (void) | |
Default constructor. | |
ACE_MEM_Addr (const ACE_MEM_Addr &) | |
Copy constructor. | |
ACE_MEM_Addr (u_short port_number) | |
Creates an ACE_MEM_Addr from a port_number. | |
ACE_MEM_Addr (const ACE_TCHAR port_name[]) | |
Creates an ACE_MEM_Addr from a port_name. | |
~ACE_MEM_Addr (void) | |
Default dtor. | |
int | initialize_local (u_short port) |
Default initialization routine. | |
int | same_host (const ACE_INET_Addr &sap) |
Check if sap designates an endpoint on the same host. | |
int | set (u_short port_number, int encode=1) |
int | set (const ACE_TCHAR port_name[]) |
virtual void * | get_addr (void) const |
Return a pointer to the underlying network address. | |
virtual void | set_addr (void *, int len) |
Set a pointer to the address. | |
virtual int | addr_to_string (ACE_TCHAR buffer[], size_t size, int ipaddr_format=1) const |
virtual int | string_to_addr (const ACE_TCHAR address[]) |
Initializes the external ACE_MEM_Addr from the address. | |
void | set_port_number (u_short, int encode=1) |
Sets the port number. | |
u_short | get_port_number (void) const |
Return the port number, converting it into host byte order. | |
int | get_host_name (ACE_TCHAR hostname[], size_t hostnamelen) const |
Return the character representation of the hostname. | |
const char * | get_host_name (void) const |
const char * | get_host_addr (void) const |
Return the "dotted decimal" external address. | |
ACE_UINT32 | get_ip_address (void) const |
const ACE_INET_Addr & | get_remote_addr (void) const |
const ACE_INET_Addr & | get_local_addr (void) const |
bool | operator== (const ACE_MEM_Addr &SAP) const |
bool | operator== (const ACE_INET_Addr &SAP) const |
bool | operator!= (const ACE_MEM_Addr &SAP) const |
Compare two addresses for inequality. | |
bool | operator!= (const ACE_INET_Addr &SAP) const |
virtual u_long | hash (void) const |
Computes and returns hash value. | |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Private Attributes | |
ACE_INET_Addr | external_ |
External INET addr used for identifying host. | |
ACE_INET_Addr | internal_ |
Internal INET addr for accepting/connecting. |
Definition at line 36 of file MEM_Addr.h.
|
Default constructor.
Definition at line 28 of file MEM_Addr.cpp. References initialize_local().
00029 : ACE_Addr (AF_INET, sizeof (ACE_MEM_Addr)) 00030 { 00031 // ACE_TRACE ("ACE_MEM_Addr::ACE_MEM_Addr"); 00032 this->initialize_local (0); 00033 } |
|
Copy constructor.
Definition at line 35 of file MEM_Addr.cpp. References ACE_TRACE, external_, internal_, and ACE_INET_Addr::set().
|
|
Creates an ACE_MEM_Addr from a port_number.
Definition at line 53 of file MEM_Addr.cpp. References ACE_TRACE, and initialize_local().
00054 : ACE_Addr (AF_INET, sizeof (ACE_MEM_Addr)) 00055 { 00056 ACE_TRACE ("ACE_MEM_Addr::ACE_MEM_Addr"); 00057 this->initialize_local (port_number); 00058 } |
|
Creates an ACE_MEM_Addr from a port_name.
Definition at line 43 of file MEM_Addr.cpp. References ACE_TCHAR, ACE_TRACE, initialize_local(), and ACE_OS::strtoul().
00044 : ACE_Addr (AF_INET, sizeof (ACE_MEM_Addr)) 00045 { 00046 ACE_TRACE ("ACE_MEM_Addr::ACE_MEM_Addr"); 00047 u_short pn = static_cast<u_short> (ACE_OS::strtoul (port_number, 00048 0, 00049 10)); 00050 this->initialize_local (pn); 00051 } |
|
Default dtor.
Definition at line 60 of file MEM_Addr.cpp.
00061 { 00062 } |
|
Transform the external ACE_MEM_Addr address into string format. Definition at line 91 of file MEM_Addr.cpp. References ACE_TCHAR, ACE_TRACE, ACE_INET_Addr::addr_to_string(), and external_.
00094 { 00095 ACE_TRACE ("ACE_MEM_Addr::addr_to_string"); 00096 00097 return this->external_.addr_to_string (s, size, ipaddr_format); 00098 } |
|
Dump the state of an object.
Reimplemented from ACE_Addr. Definition at line 156 of file MEM_Addr.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TRACE, ACE_INET_Addr::dump(), external_, internal_, and LM_DEBUG.
|
|
Return a pointer to the underlying network address.
Reimplemented from ACE_Addr. Definition at line 116 of file MEM_Addr.cpp. References ACE_TRACE, external_, and ACE_INET_Addr::get_addr().
|
|
Return the "dotted decimal" external address.
Definition at line 49 of file MEM_Addr.inl. References ACE_TRACE, ACE_INET_Addr::get_host_addr(), and internal_.
00050 { 00051 ACE_TRACE ("ACE_MEM_Addr::get_host_addr"); 00052 return this->internal_.get_host_addr (); 00053 } |
|
Return the character representation of the hostname (this version is non-reentrant since it returns a pointer to a static data area). Definition at line 143 of file MEM_Addr.cpp. References ACE_TRACE, external_, and ACE_INET_Addr::get_host_name().
00144 { 00145 ACE_TRACE ("ACE_MEM_Addr::get_host_name"); 00146 return this->external_.get_host_name (); 00147 } |
|
Return the character representation of the hostname.
Definition at line 133 of file MEM_Addr.cpp. References ACE_TCHAR, ACE_TRACE, external_, and ACE_INET_Addr::get_host_name().
00135 { 00136 ACE_TRACE ("ACE_MEM_Addr::get_host_name"); 00137 return this->external_.get_host_name (hostname, len); 00138 } |
|
Return the 4-byte external IP address, converting it into host byte order. Definition at line 58 of file MEM_Addr.inl. References ACE_TRACE, external_, and ACE_INET_Addr::get_ip_address().
00059 { 00060 ACE_TRACE ("ACE_MEM_Addr::get_ip_address"); 00061 return this->external_.get_ip_address (); 00062 } |
|
Definition at line 65 of file MEM_Addr.inl. References internal_. Referenced by ACE_MEM_Acceptor::open().
00066 { 00067 return this->internal_; 00068 } |
|
Return the port number, converting it into host byte order.
Definition at line 40 of file MEM_Addr.inl. References ACE_TRACE, ACE_INET_Addr::get_port_number(), and internal_. Referenced by ACE_MEM_Connector::connect().
00041 { 00042 ACE_TRACE ("ACE_MEM_Addr::get_port_number"); 00043 return this->internal_.get_port_number (); 00044 } |
|
Definition at line 71 of file MEM_Addr.inl. References external_.
00072 { 00073 return this->external_; 00074 } |
|
Computes and returns hash value.
Reimplemented from ACE_Addr. Definition at line 150 of file MEM_Addr.cpp. References external_, and ACE_INET_Addr::hash().
|
|
Default initialization routine.
Definition at line 65 of file MEM_Addr.cpp. References ACE_LIB_TEXT, ACE_TCHAR, external_, ACE_OS::hostname(), internal_, MAXHOSTNAMELEN, and ACE_INET_Addr::set(). Referenced by ACE_MEM_Addr().
00066 { 00067 ACE_TCHAR name[MAXHOSTNAMELEN + 1]; 00068 if (ACE_OS::hostname (name, MAXHOSTNAMELEN+1) == -1) 00069 return -1; 00070 00071 this->external_.set (port_number, name); 00072 this->internal_.set (port_number, ACE_LIB_TEXT ("localhost")); 00073 return 0; 00074 } |
|
Definition at line 105 of file MEM_Addr.inl. References ACE_TRACE.
00106 { 00107 ACE_TRACE ("ACE_MEM_Addr::operator !="); 00108 return !((*this) == sap); 00109 } |
|
Compare two addresses for inequality.
Definition at line 98 of file MEM_Addr.inl. References ACE_TRACE.
00099 { 00100 ACE_TRACE ("ACE_MEM_Addr::operator !="); 00101 return !((*this) == sap); 00102 } |
|
Definition at line 88 of file MEM_Addr.inl. References ACE_TRACE, and external_.
|
|
Compare two addresses for equality. The addresses are considered equal if they contain the same IP address and port number. Definition at line 79 of file MEM_Addr.inl. References ACE_TRACE, external_, and internal_.
|
|
Check if sap designates an endpoint on the same host.
Definition at line 77 of file MEM_Addr.cpp. References ACE_TRACE, and ACE_INET_Addr::set_port_number(). Referenced by ACE_MEM_Connector::connect().
00078 { 00079 ACE_TRACE ("ACE_MEM_Addr::same_host"); 00080 00081 // ACE_INET_Addr::operator== takes port number into account, so get 00082 // the addresses without a port number and compare. 00083 ACE_INET_Addr me (this->external_); 00084 ACE_INET_Addr you (sap); 00085 me.set_port_number (0); 00086 you.set_port_number (0); 00087 return me == you; 00088 } |
|
Uses to initialize an ACE_MEM_Addr from a , the remote , and the . Definition at line 31 of file MEM_Addr.inl. References ACE_TCHAR, ACE_TRACE, and string_to_addr().
00032 { 00033 ACE_TRACE ("ACE_MEM_Addr::set"); 00034 return this->string_to_addr (port_number); 00035 } |
|
Initializes an ACE_MEM_Addr from a port_number. If encode is enabled then port_number is converted into network byte order, otherwise it is assumed to be in network byte order already and are passed straight through. Definition at line 23 of file MEM_Addr.inl. References ACE_TRACE, and set_port_number(). Referenced by string_to_addr().
00024 { 00025 ACE_TRACE ("ACE_MEM_Addr::set"); 00026 this->set_port_number (port_number, encode); 00027 return 0; 00028 } |
|
Set a pointer to the address.
Reimplemented from ACE_Addr. Definition at line 124 of file MEM_Addr.cpp. References ACE_TRACE, external_, internal_, ACE_INET_Addr::set_addr(), and ACE_INET_Addr::set_port_number().
00125 { 00126 ACE_TRACE ("ACE_MEM_Addr::set_addr"); 00127 00128 this->external_.set_addr (addr, len); 00129 this->internal_.set_port_number (this->external_.get_port_number ()); 00130 } |
|
Sets the port number.
Definition at line 13 of file MEM_Addr.inl. References ACE_TRACE, external_, internal_, and ACE_INET_Addr::set_port_number(). Referenced by ACE_MEM_Acceptor::accept(), ACE_MEM_Connector::connect(), ACE_MEM_Acceptor::get_local_addr(), and set().
00015 { 00016 ACE_TRACE ("ACE_MEM_Addr::set_port_number"); 00017 00018 this->external_.set_port_number (port_number, encode); 00019 this->internal_.set_port_number (port_number, encode); 00020 } |
|
Initializes the external ACE_MEM_Addr from the address.
Definition at line 103 of file MEM_Addr.cpp. References ACE_TCHAR, ACE_TRACE, set(), and ACE_OS::strtoul(). Referenced by set().
00104 { 00105 ACE_TRACE ("ACE_MEM_Addr::string_to_addr"); 00106 00107 u_short pn = static_cast<u_short> (ACE_OS::strtoul (s, 00108 0, 00109 10)); 00110 return this->set (pn); 00111 } |
|
Declare the dynamic allocation hooks.
Reimplemented from ACE_Addr. Definition at line 137 of file MEM_Addr.h. |
|
External INET addr used for identifying host.
Definition at line 141 of file MEM_Addr.h. Referenced by ACE_MEM_Addr(), addr_to_string(), dump(), get_addr(), get_host_name(), get_ip_address(), get_remote_addr(), hash(), initialize_local(), operator==(), set_addr(), and set_port_number(). |
|
Internal INET addr for accepting/connecting.
Definition at line 144 of file MEM_Addr.h. Referenced by ACE_MEM_Addr(), dump(), get_host_addr(), get_local_addr(), get_port_number(), initialize_local(), operator==(), set_addr(), and set_port_number(). |