Solved

Continually listening multicast receiver

Posted on 2004-08-27
1
202 Views
Last Modified: 2013-12-03
I need to know if it would be OK for a multicast receiver to continually listen for data from a multicast sender.  If so, what would be the best way for me to construct the receiver?  I was thinking of the following way (see pseudocode):

/**********************************/

Create UDP socket
Construct bind structure
Bind to multicast port
Specify multicast group
Join multicast group

While loop begin
    listen and receive data using recvfrom
Continue until told to stop

Close socket when finished

/**********************************/

Is it okay to continually check for data using a while loop or would this cause problems (especially to other multicast receivers)?
And just for your info, I will be programming in C using Winsock.
0
Comment
Question by:jtrades
1 Comment
 
LVL 8

Accepted Solution

by:
mxjijo earned 250 total points
ID: 11917403

   Your basic design would definitly work.
Try to use non-blocking or async recv methods to make it more professional.

>> would this cause problems (especially to other multicast receivers)?
     No. Receiving data on one machine will NOT affect other receivers on the network.
If once a client joins the multicast group, that client will get a copy of the data no matter
whether there are other clients receiving it or not.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now