1 // Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
3 #include "AddrServer.h"
4 #include "ace/INET_Addr.h"
6 AddrServer::AddrServer (const ACE_INET_Addr
& addr
)
8 #if defined (ACE_HAS_IPV6)
9 if (addr
.get_type() == PF_INET6
)
11 RtecUDPAdmin::UDP_Addr_v6 v6
;
13 reinterpret_cast<sockaddr_in6
*>(addr
.get_addr());
14 ACE_OS::memcpy (v6
.ipaddr
,&in6
->sin6_addr
,16);
15 v6
.port
= addr
.get_port_number();
16 this->addr_
.v6_addr (v6
);
19 #endif /* ACE_HAS_IPV6 */
20 RtecUDPAdmin::UDP_Addr v4
;
21 v4
.ipaddr
= addr
.get_ip_address ();
22 v4
.port
= addr
.get_port_number ();
23 this->addr_
.v4_addr (v4
);
27 AddrServer::get_addr (const RtecEventComm::EventHeader
&,
28 RtecUDPAdmin::UDP_Addr
& addr
)
30 if (this->addr_
._d() == RtecUDPAdmin::Rtec_inet6
)
31 throw CORBA::DATA_CONVERSION(0, CORBA::COMPLETED_YES
);
32 addr
= this->addr_
.v4_addr();
37 AddrServer::get_address (const RtecEventComm::EventHeader
&,
38 RtecUDPAdmin::UDP_Address_out addr
)