diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-04-09 21:21:21 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-04-09 21:21:21 +0000 |
commit | 49f429132a0d41ef6d6d58dec4fb735c5decc5a5 (patch) | |
tree | d764369ec52fd77727d164e21e8ec072ebd0180e /ace/LSOCK_Stream.cpp | |
parent | 7fde5f76146c6c3aed3f0a302192ef0e32cf2b12 (diff) | |
download | ATCD-49f429132a0d41ef6d6d58dec4fb735c5decc5a5.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/LSOCK_Stream.cpp')
-rw-r--r-- | ace/LSOCK_Stream.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/ace/LSOCK_Stream.cpp b/ace/LSOCK_Stream.cpp index ede35683ee1..02e35c2e15d 100644 --- a/ace/LSOCK_Stream.cpp +++ b/ace/LSOCK_Stream.cpp @@ -9,10 +9,32 @@ ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK_Stream) int -ACE_LSOCK_Stream::get_remote_addr (ACE_Addr &a) const +ACE_LSOCK_Stream::get_local_addr (ACE_Addr &addr) const +{ + ACE_TRACE ("ACE_LSOCK_Stream::get_local_addr"); + + // Perform the downcast since <addr> had better be an + // <ACE_UNIX_Addr>. + ACE_UNIX_Addr *rhs_unix_addr = ACE_dynamic_cast (ACE_UNIX_Addr *, &addr); + ACE_UNIX_Addr lhs_unix_addr; + + if (rhs_unix_addr == 0) + return -1; + else if (ACE_SOCK::get_local_addr (lhs_unix_addr) == -1) + return -1; + else + { + *rhs_unix_addr = lhs_unix_addr; + return 0; + } +} + +int +ACE_LSOCK_Stream::get_remote_addr (ACE_Addr &addr) const { ACE_TRACE ("ACE_LSOCK_Stream::get_remote_addr"); - return ACE_SOCK_Stream::get_remote_addr (a); + + return this->get_local_addr (addr); } void |