Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / protocols / tests / RMCast / Sender.cpp
blob62d9072612c27749a7c08ff02b94897a19da2b27
1 // file : Sender.cpp
2 // author : Boris Kolpackov <boris@kolpackov.net>
3 #include "ace/Log_Msg.h"
4 #include "ace/OS_NS_unistd.h"
6 #include "ace/RMCast/Socket.h"
8 #include "Protocol.h"
10 class args {};
12 int
13 ACE_TMAIN (int argc, ACE_TCHAR* argv[])
15 try
17 if (argc < 2) throw args ();
19 ACE_INET_Addr addr (argv[1]);
21 //FUZZ: disable check_for_lack_ACE_OS
22 // Turn on message loss and reordering simulation.
24 ACE_RMCast::Socket socket (addr, false, true);
25 //FUZZ: enable check_for_lack_ACE_OS
27 Message msg;
28 msg.sn = 0;
30 for (unsigned short i = 0; i < payload_size; i++)
32 msg.payload[i] = i;
35 for (; msg.sn < message_count; msg.sn++)
37 socket.send (&msg, sizeof (msg));
40 // Keep running in case retransmissions are needed.
42 ACE_OS::sleep (ACE_Time_Value (60, 0));
44 return 0;
46 catch (args const&)
48 ACE_ERROR ((LM_ERROR,
49 "usage: %s <IPv4 multicast address>:<port>\n", argv[0]));
52 return 1;