2 #include "ace/OS_NS_string.h"
4 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
6 // Creates a ACE_INET_Addr from a PORT_NUMBER and the remote
8 ACE::HTBP::Addr::Addr (u_short port_number
,
9 const char host_name
[],
11 : ACE_INET_Addr (port_number
, host_name
, address_family
),
16 ACE::HTBP::Addr::Addr (const char *htid
)
21 ACE::HTBP::Addr::Addr (const ACE::HTBP::Addr
&other
)
22 : ACE_INET_Addr (other
),
28 ACE::HTBP::Addr::set (u_short port
,
32 if (htid
!= 0 && ACE_OS::strlen (htid
) != 0)
33 return this->set_htid (htid
);
34 return this->ACE_INET_Addr::set(port
,host
);
38 ACE::HTBP::Addr::set_htid (const char *htid
)
41 this->set_port_number (0);
46 ACE::HTBP::Addr::get_htid () const
48 return this->htid_
.c_str();
52 ACE::HTBP::Addr::addr_to_string (ACE_TCHAR buffer
[],
54 int ipaddr_format
) const
56 if (this->htid_
.length() == 0)
57 return this->ACE_INET_Addr::addr_to_string(buffer
,size
,ipaddr_format
);
58 if (size
< htid_
.length())
60 ACE_OS::strncpy (buffer
,
61 ACE_TEXT_CHAR_TO_TCHAR(htid_
.c_str()),
67 ACE::HTBP::Addr::string_to_addr (const char address
[],
70 // if (ACE_OS::strchr (address,':'))
71 return this->ACE_INET_Addr::string_to_addr(address
, address_family
);
72 // this->htid_ = address;
76 ACE_END_VERSIONED_NAMESPACE_DECL