diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-10-02 17:54:47 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-10-02 17:54:47 +0000 |
commit | a985552dae2b98899a603977cfd747b5c3449aeb (patch) | |
tree | 3f44277a13494a7c60060259cf2998f1b2a94474 /ace | |
parent | 78f8a3779e76196afadd536e3d958374ba5fc338 (diff) | |
download | ATCD-a985552dae2b98899a603977cfd747b5c3449aeb.tar.gz |
ChangeLogTag:Sat Oct 2 12:50:43 1999 Douglas C. Schmidt <schmidt@danzon.cs.wustl.edu>
Diffstat (limited to 'ace')
-rw-r--r-- | ace/INET_Addr.cpp | 41 | ||||
-rw-r--r-- | ace/INET_Addr.h | 16 |
2 files changed, 38 insertions, 19 deletions
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index 24cbb2988cf..0c989293c1d 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -273,7 +273,8 @@ ACE_INET_Addr::set (u_short port_number, int ACE_INET_Addr::set (const ASYS_TCHAR port_name[], - const ASYS_TCHAR host_name[]) + const ASYS_TCHAR host_name[], + const ASYS_TCHAR protocol[]) { ACE_TRACE ("ACE_INET_Addr::set"); @@ -286,7 +287,7 @@ ACE_INET_Addr::set (const ASYS_TCHAR port_name[], ACE_SERVENT_DATA buf; servent *sp = ACE_OS::getservbyname_r ((char *) port_name, - "tcp", + (char *) protocol, &sentry, buf); if (sp == 0) @@ -301,7 +302,8 @@ ACE_INET_Addr::set (const ASYS_TCHAR port_name[], int ACE_INET_Addr::set (const ASYS_TCHAR port_name[], - ACE_UINT32 inet_address) + ACE_UINT32 inet_address, + const ASYS_TCHAR protocol[]) { ACE_TRACE ("ACE_INET_Addr::set"); @@ -314,7 +316,7 @@ ACE_INET_Addr::set (const ASYS_TCHAR port_name[], ACE_SERVENT_DATA buf; servent *sp = ACE_OS::getservbyname_r ((char *) port_name, - "tcp", + (char *) protocol, &sentry, buf); if (sp == 0) @@ -329,10 +331,13 @@ ACE_INET_Addr::set (const ASYS_TCHAR port_name[], ACE_INET_Addr::ACE_INET_Addr (u_short port_number, - const ASYS_TCHAR host_name[]) + const ASYS_TCHAR host_name[], + const ASYS_TCHAR protocol[]) { ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - if (this->set (port_number, host_name) == -1) + if (this->set (port_number, + host_name, + protocol) == -1) #if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) ACE_ERROR ((LM_ERROR, (char *) "ACE_INET_Addr::ACE_INET_Addr: %p\n", @@ -397,10 +402,13 @@ ACE_INET_Addr::ACE_INET_Addr (u_short port_number, // HOST_NAME. ACE_INET_Addr::ACE_INET_Addr (const ASYS_TCHAR port_name[], - const ASYS_TCHAR host_name[]) + const ASYS_TCHAR host_name[], + const ASYS_TCHAR protocol[]) { ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - if (this->set (port_name, host_name) == -1) + if (this->set (port_name, + host_name, + protocol) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); } @@ -408,17 +416,21 @@ ACE_INET_Addr::ACE_INET_Addr (const ASYS_TCHAR port_name[], // Creates a ACE_INET_Addr from a PORT_NAME and an Internet address. -ACE_INET_Addr::ACE_INET_Addr (const ASYS_TCHAR *port_name, - ACE_UINT32 inet_address) +ACE_INET_Addr::ACE_INET_Addr (const ASYS_TCHAR port_name[], + ACE_UINT32 inet_address, + const ASYS_TCHAR protocol[]) { ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - if (this->set (port_name, inet_address) == -1) + if (this->set (port_name, + inet_address, + protocol) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); } int -ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[], size_t len) const +ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[], + size_t len) const { ACE_TRACE ("ACE_INET_Addr::get_host_name"); @@ -433,8 +445,9 @@ ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[], size_t len) const { #if defined (VXWORKS) ACE_UNUSED_ARG (len); - int error = ::hostGetByAddr ((int) this->inet_addr_.sin_addr.s_addr, - hostname); + int error = + ::hostGetByAddr ((int) this->inet_addr_.sin_addr.s_addr, + hostname); if (error == OK) return 0; else diff --git a/ace/INET_Addr.h b/ace/INET_Addr.h index 4958e08e0ed..64fee4a14e3 100644 --- a/ace/INET_Addr.h +++ b/ace/INET_Addr.h @@ -41,7 +41,9 @@ public: ACE_INET_Addr (const sockaddr_in *, int len); // Creates an <ACE_INET_Addr> from a sockaddr_in structure. - ACE_INET_Addr (u_short port_number, const ASYS_TCHAR host_name[]); + ACE_INET_Addr (u_short port_number, + const ASYS_TCHAR host_name[], + const ASYS_TCHAR protocol[] = "tcp"); // Creates an <ACE_INET_Addr> from a <port_number> and the remote // <host_name>. @@ -59,12 +61,14 @@ public: // are in host byte order. ACE_INET_Addr (const ASYS_TCHAR port_name[], - const ASYS_TCHAR host_name[]); + const ASYS_TCHAR host_name[], + const ASYS_TCHAR protocol[] = "tcp"); // Uses <getservbyname> to create an <ACE_INET_Addr> from a // <port_name> and the remote <host_name>. ACE_INET_Addr (const ASYS_TCHAR port_name[], - ACE_UINT32 ip_addr); + ACE_UINT32 ip_addr, + const ASYS_TCHAR protocol[] = "tcp"); // Uses <getservbyname> to create an <ACE_INET_Addr> from a // <port_name> and an Internet <ip_addr>. This method assumes that // <ip_addr> is in host byte order. @@ -97,12 +101,14 @@ public: // passed straight through. int set (const ASYS_TCHAR port_name[], - const ASYS_TCHAR host_name[]); + const ASYS_TCHAR host_name[], + const ASYS_TCHAR protocol[] = "tcp"); // Uses <getservbyname> to initialize an <ACE_INET_Addr> from a // <port_name> and the remote <host_name>. int set (const ASYS_TCHAR port_name[], - ACE_UINT32 ip_addr); + ACE_UINT32 ip_addr, + const ASYS_TCHAR protocol[] = "tcp"); // Uses <getservbyname> to initialize an <ACE_INET_Addr> from a // <port_name> and an Internet address. This assumes that <ip_addr> // is already in network byte order. |