views:

54

answers:

1

Hi all,

I would like to write an application which will stream data at 2400 baud over the internet from a server to multiple clients. The data will be the same for each client, and it would probably be fine to send it as a UDP stream, since exact data accuracy is not a 100% necessity, as there are checksums built-in to the data format and the data will be sent repeatedly on a loop.

What is the best way to do this? I would want to write the server in C, but I don't know how to best multicast this data to the different clients that would be receiving it all over the country.

I'm sure this seems like a pretty draconian way to go about my project, as opposed to just using some sort of fetch command, but I'd prefer to do it this way if possible.

A: 

You may wish to take a look at unicast for this, particularly if your clients are on multiple directories. You should be able to send TCP or UDP traffic out with your data to each of your clients, particularly if bandwidth needs are small. IP multicast works best to groups of nodes on networks near each other.

Loop over client addresses repeatedly, and send your data. Moderate the rate at which you loop to limit the data rate.

Pay attention to the reliability issue: correctness is not the only problem with UDP; you also have no acknowledgment that your data was received, and no guarantee on ordering.

Baud doesn't really apply here, as the data is segmented into more or less discrete chunks.

WhirlWind
Right, I don't need acknowledgment, I just need it to be sent out.And as far as baud, I just need to limit the speed somewhat. It's not that I need the data itself to go out at 2400 baud, obviously this is the internet and that doesn't apply. The thing is, the data will end up being transmitted via serial at a rate of 2400 baud from a PC to a character generator sorta thing, so I will just need to not send data out so quickly that it overloads the messages going over the serial. I will probably just set a 1 second delay between messages, which should make everything alright.
AriX
As far as unicast, are you suggesting that I just send the data uniquely to each IP? That may be what I end up doing.
AriX
Yeah, I'd just send the data to each IP individually. If I were you, I'd do it with unicast, and a sleep delay to start with, and refine from there to meet your needs.
WhirlWind