Solved

Continually listening multicast receiver

Posted on 2004-08-27
1
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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