diff options
author | Phil Mesnier <mesnier_p@ociweb.com> | 2007-05-30 02:10:09 +0000 |
---|---|---|
committer | Phil Mesnier <mesnier_p@ociweb.com> | 2007-05-30 02:10:09 +0000 |
commit | b359a4595d56c3a14f2f5d04fe393dfef14e6789 (patch) | |
tree | 7bda75fd3afe9c95f7f13be8b590879169ca0254 /TAO | |
parent | ee20e952d679ba95752e399bc5359fec920b6a66 (diff) | |
download | ATCD-b359a4595d56c3a14f2f5d04fe393dfef14e6789.tar.gz |
Wed May 30 02:05:51 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLog | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp | 31 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp | 6 |
4 files changed, 43 insertions, 10 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 8a8299aed64..7b575d73a37 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,11 @@ +Wed May 30 02:05:51 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com> + + * orbsvcs/tests/EC_MT_Mcast/AddrServer.h: + * orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp: + * orbsvcs/tests/EC_MT_Mcast/MCast.cpp: + + Fixed yet another implementation of a simple address server. + Tue May 29 14:11:17 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com> * orbsvcs/examples/RtEC/MCast/AddrServer.h: diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp b/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp index dbaff8c8d25..7b937301170 100644 --- a/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp +++ b/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp @@ -7,14 +7,39 @@ ACE_RCSID(EC_MT_Mcast, AddrServer, "$Id$") -AddrServer::AddrServer (const RtecUDPAdmin::UDP_Addr& addr) - : addr_ (addr) +AddrServer::AddrServer (const ACE_INET_Addr& addr) { +#if defined (ACE_HAS_IPV6) + if (addr.get_type() == PF_INET6) + { + RtecUDPAdmin::UDP_Addr_v6 v6; + sockaddr_in6 *in6 = + reinterpret_cast<sockaddr_in6 *>(addr.get_addr()); + ACE_OS::memcpy (v6.ipaddr,&in6->sin6_addr,16); + v6.port = addr.get_port_number(); + this->addr_.v6_addr (v6); + return; + } +#endif /* ACE_HAS_IPV6 */ + RtecUDPAdmin::UDP_Addr v4; + v4.ipaddr = addr.get_ip_address (); + v4.port = addr.get_port_number (); + this->addr_.v4_addr (v4); } void AddrServer::get_addr (const RtecEventComm::EventHeader&, - RtecUDPAdmin::UDP_Addr_out addr) + RtecUDPAdmin::UDP_Addr& addr) +{ + if (this->addr_._d() == RtecUDPAdmin::INET6) + throw CORBA::DATA_CONVERSION(0, CORBA::COMPLETED_YES); + addr = this->addr_.v4_addr(); +} + + +void +AddrServer::get_address (const RtecEventComm::EventHeader&, + RtecUDPAdmin::UDP_Address_out addr) { addr = this->addr_; } diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h b/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h index 0f7a7931366..02a10bbe3b4 100644 --- a/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h +++ b/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h @@ -6,6 +6,7 @@ #include /**/ "ace/pre.h" #include "orbsvcs/RtecUDPAdminS.h" +#include "ace/INET_Addr.h" class AddrServer : public POA_RtecUDPAdmin::AddrServer { @@ -22,15 +23,18 @@ class AddrServer : public POA_RtecUDPAdmin::AddrServer // provided at initialization time. // public: - AddrServer (const RtecUDPAdmin::UDP_Addr& addr); + AddrServer (const ACE_INET_Addr &addr); // Constructor // = The RtecUDPAdmin::AddrServer methods virtual void get_addr (const RtecEventComm::EventHeader& header, RtecUDPAdmin::UDP_Addr_out addr); + virtual void get_address (const RtecEventComm::EventHeader& header, + RtecUDPAdmin::UDP_Address_out addr); + private: - RtecUDPAdmin::UDP_Addr addr_; + RtecUDPAdmin::UDP_Address addr_; // The address }; diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp b/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp index c4cb41d0a6a..3a5e7cc76f1 100644 --- a/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp +++ b/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp @@ -155,12 +155,9 @@ main (int argc, char* argv[]) ACE_DEBUG ((LM_DEBUG, "Multicast address is: %s\n", udp_mcast_address)); - RtecUDPAdmin::UDP_Addr addr; - addr.ipaddr = udp_addr.get_ip_address (); - addr.port = udp_addr.get_port_number (); // Now we create and activate the servant - AddrServer as_impl (addr); + AddrServer as_impl (udp_addr); RtecUDPAdmin::AddrServer_var address_server = as_impl._this (); @@ -379,4 +376,3 @@ int parse_args (int argc, char *argv[]) // Indicates sucessful parsing of the command line return 0; } - |