![]() |
C++ World |
C++ Resources, Tips, Documentation, Examples, HOWTO's, FAQ's, Tools Libraries, Frameworks, IDE's © 2005,2009 C++ World - All rights reserved - webdesign.arttina |
|---|
| C++, Sockets, SysProg, Libraries, Examples, Tools, Compilers, IDE, STL, XML |
|
| FAQ | Sockets | Socket Library | Software Engineering | Sysprog | Examples | Books |
|---|
| Home |
|---|
| C++ |
| The C Language |
| STL |
| BOOST |
| GNU |
| GNU C Compiler |
| GNU Debugger |
| GNU Profiler |
| HP C++ Compiler |
| DDD |
| Eclipse |
| Curses |
| XML |
| X11 |
| KDevelop |
| MS Visual Studio |
| Tutorials |
// **************************************************************
// Com ++ Framework by the C++ World
// Please report defects: mailto:compp@cplusplusworld.com
// Please visit: http://www.cplusplusworld.com/socketlibrary.html
// **************************************************************
#include <iostream>
#include <cstdlib>
#include "ComPlusPlus/ComPlusPlus"
int main ( int argc, char *argv [] ) {
if ( argc != 3 ) {
std::cout << "Usage: " << argv [0] << " port group \n";
exit(1);
}
int SPort = atoi (argv[1]);
std::string MGS = argv[2];
try {
char buf[1000];
std::memset( (void*)buf, 0, sizeof ( buf ) );
compp::SocketUdp Clnt;
// Clnt.SetSockOptJoinMulticastGroup(MGS);
// -> Comment 1
Clnt.Sendto("Hello Multi1!", strlen("Hello Multi1!")+1, MGS, SPort);
return 0;
} catch ( syspp::ComException e ) {
std::cout << "Exception " << e.what( ) << "\n" ;
perror ( "Multicast Test");
}
}
| Franz Brandel | Contact | Legal Statement | Sitemap | C++ World |