Bhamy Madhava Shenoy wrote:
> Can anyone help me for the UDP questions which I have below.
>
> Basically I what I need to know is
>
> a) how does a server sends a UDP broadcast to all the machines on a network
> ? - What all function calls and what flags & arguments are to be given?
Broadcast UDP is the same as unicast UDP, except:
1. You have to enable broadcasts, with:
int one = 1;
setsockopt(skt_fd, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one));
2. You have to specify a broadcast address as the destination.
> b) How do I receive such a message on the client side.
The same way that you receive a unicast UDP packet, e.g. with
recvfrom().
--
Glynn Clements <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]