tags:

views:

62

answers:

2

I'm trying to do something like this. There is one server , and multiple clients in the same subnet. Clients will send something to server and server will send this message back to all the other clients in the subnet. So this looks like broadcast to me. But i never could manage to do this in C.. I'd be glad if you give me an example of this.

EDIT: Well since it is UDP , reliability is not a problem. These computers are in the same network and no packet lost is possible. That program does not recieve messages from other clients. That is what I have to do. Thanks by the way.

A: 

[The contents of this post have been moved to the question.]

Emre Kaya
Artelius
+1  A: 

You should not use broadcast, but rather multicast. This is used for instance by ghost and other "images disk backup" over network.

I have done it in java with a MulticastSocket sending a DatagramPacket, if you need a test...

Aif
well it doesn't matter if this packets go to all ip's in the subnet. Since i may not know the other clients' ip address , all i have to do is to send them all..
Emre Kaya