Multicast in c++
-
Hi everyone! Is there anyone that has implement a multicast program on c++, that join a multicast group. When it had join a group it will logg traffic and saves it in a circular buffer. But first I will have some help with joining a multicast group. Please help me, Stefan
-
Hi everyone! Is there anyone that has implement a multicast program on c++, that join a multicast group. When it had join a group it will logg traffic and saves it in a circular buffer. But first I will have some help with joining a multicast group. Please help me, Stefan
You need to make sure that your router supports multicast.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table. Shameless Plug - Distributed Database Transactions in .NET using COM+
-
Hi everyone! Is there anyone that has implement a multicast program on c++, that join a multicast group. When it had join a group it will logg traffic and saves it in a circular buffer. But first I will have some help with joining a multicast group. Please help me, Stefan
Code to Join:
struct ip_mreq mreq; // mreq is the ip_mreqstructure { struct in_addr imr_multiaddr; //The multicast group to join struct in_addr imr_interface; //The interface to join on } #define RECV_IP_ADDR "225.6.7.8" // An arbitrary multicast address mreq.imr_multiaddr.s_addr = inet_addr(RECV_IP_ADDR); mreq.imr_interface.s_addr = INADDR_ANY; err = setsockopt( sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*)&mreq, sizeof(mreq));
Igor Proskuriakov