[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Continually listening multicast receiver

Posted on 2004-08-27
1
Medium Priority
?
220 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 750 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

656 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