9 #include <ace/Time_Value.h>
10 #include <ace/OS_NS_sys_socket.h>
16 ACE_OS::socket_init(2,2);
22 ACE_OS::socket_fini();
27 mSocket=
new ACE_SOCK_Dgram_Bcast(ACE_INET_Addr(port,address.c_str()));
34 mSocket=
new ACE_SOCK_Dgram_Bcast(ACE_INET_Addr(port,address));
44 ACE_UINT32 address = ntohl(ipv4);
45 return Create(port, address);
50 mSocket->send(
data,len,ACE_INET_Addr(port,address.c_str()));
55 mSocket->send(
data,len,ACE_INET_Addr(port,address));
60 ACE_UINT32 address = ntohl(ipv4);
61 mSocket->send(
data, len, ACE_INET_Addr(port, address));
77 ACE_Time_Value tv(wait_msec/1000,(wait_msec%1000)*1000);
78 ACE_INET_Addr ace_addr;
79 ssize_t nrec=
mSocket->recv(
data,len,ace_addr,0,&tv);
83 address=ace_addr.get_host_addr();
84 port=ace_addr.get_port_number();
97 ACE_Time_Value tv(wait_msec/1000,(wait_msec%1000)*1000);
98 ACE_INET_Addr ace_addr;
99 ssize_t nrec=
mSocket->recv(
data,len,ace_addr,0,&tv);
103 address=ace_addr.get_ip_address();
104 port=ace_addr.get_port_number();
118 ACE_Time_Value tv(wait_msec/1000, (wait_msec%1000)*1000);
119 ACE_INET_Addr ace_addr;
120 ssize_t nrec =
mSocket->recv(
data, len, ace_addr, 0, &tv);
125 ipv4 = htonl(ace_addr.get_ip_address());
126 port = ace_addr.get_port_number();
void SendTo(eOipv4addr_t ipv4, eOipv4port_t port, void *data, size_t len)
ACE_SOCK_Dgram_Bcast * mSocket
bool Create(ACE_UINT16 port, std::string &address)
void SendBroad(eOipv4port_t port, void *data, size_t len)
ssize_t ReceiveFrom(eOipv4addr_t &ipv4, eOipv4port_t &port, void *data, size_t len, int wait_msec)