00001
00002
00003
00004
00005
00006
00007 #include <iostream>
00008 #include <cstdlib>
00009 #include "ComPlusPlus/ComPlusPlus"
00010
00011 int main ( int argc, char *argv [] ) {
00012
00013 if ( argc != 3 ) {
00014 std::cout << "Usage: " << argv [0] << " port group \n";
00015 exit(1);
00016 }
00017
00018 int SPort = atoi (argv[1]);
00019 std::string MGS = argv[2];
00020
00021 try {
00022 char buf[1000];
00023 std::memset( (void*)buf, 0, sizeof ( buf ) );
00024 compp::SocketUdp Clnt;
00025
00026
00027
00028
00029 Clnt.Sendto("Hello Multi1!", strlen("Hello Multi1!")+1, MGS, SPort);
00030 return 0;
00031 } catch ( syspp::ComException e ) {
00032 std::cout << "Exception " << e.what( ) << "\n" ;
00033 perror ( "Multicast Test");
00034 }
00035 }