3 #include "ace/Global_Macros.h"
5 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
7 /// Set the port number.
9 ACE_MEM_Addr::set_port_number (u_short port_number,
12 ACE_TRACE ("ACE_MEM_Addr::set_port_number");
14 this->external_.set_port_number (port_number, encode);
15 this->internal_.set_port_number (port_number, encode);
19 ACE_MEM_Addr::set (u_short port_number, int encode)
21 ACE_TRACE ("ACE_MEM_Addr::set");
22 this->set_port_number (port_number, encode);
27 ACE_MEM_Addr::set (const ACE_TCHAR port_number[])
29 ACE_TRACE ("ACE_MEM_Addr::set");
30 return this->string_to_addr (port_number);
33 /// Return the port number.
35 ACE_MEM_Addr::get_port_number () const
37 ACE_TRACE ("ACE_MEM_Addr::get_port_number");
38 return this->internal_.get_port_number ();
41 /// Return the "dotted decimal" external address.
42 ACE_INLINE const char *
43 ACE_MEM_Addr::get_host_addr () const
45 ACE_TRACE ("ACE_MEM_Addr::get_host_addr");
46 return this->external_.get_host_addr ();
49 /// Return the "dotted decimal" external address.
50 ACE_INLINE const char *
51 ACE_MEM_Addr::get_host_addr (char *addr, int addr_size) const
53 ACE_TRACE ("ACE_MEM_Addr::get_host_addr");
54 return this->external_.get_host_addr (addr, addr_size);
57 /// Return the 4-byte IP address, converting it into host byte order.
59 ACE_MEM_Addr::get_ip_address () const
61 ACE_TRACE ("ACE_MEM_Addr::get_ip_address");
62 return this->external_.get_ip_address ();
65 ACE_INLINE const ACE_INET_Addr &
66 ACE_MEM_Addr::get_local_addr () const
68 return this->internal_;
71 ACE_INLINE const ACE_INET_Addr &
72 ACE_MEM_Addr::get_remote_addr () const
74 return this->external_;
77 /// Compare two addresses for equality.
79 ACE_MEM_Addr::operator == (const ACE_MEM_Addr &sap) const
81 ACE_TRACE ("ACE_MEM_Addr::operator ==");
83 return this->external_ == sap.external_ &&
84 this->internal_ == sap.internal_;
88 ACE_MEM_Addr::operator == (const ACE_INET_Addr &sap) const
90 ACE_TRACE ("ACE_MEM_Addr::operator ==");
92 return this->external_ == sap;
95 /// Compare two addresses for inequality.
97 ACE_MEM_Addr::operator != (const ACE_MEM_Addr &sap) const
99 ACE_TRACE ("ACE_MEM_Addr::operator !=");
100 return !((*this) == sap);
104 ACE_MEM_Addr::operator != (const ACE_INET_Addr &sap) const
106 ACE_TRACE ("ACE_MEM_Addr::operator !=");
107 return !((*this) == sap);
110 ACE_END_VERSIONED_NAMESPACE_DECL