Broadcast over UDP socket 
Author Message
 Broadcast over UDP socket

System : Ultra 10 / Solaris 2.6
Language : C

I try to setup a very simple client/serverprogram using
broadcast over UDP sockets (SOCK_DGRAM).

The server creates a SOCK_DGRAM internet socket,
enables broadcast option for this socket (is the option
value to use 1 ?), binds it to a specific port nb, and
waits for a request using recvfrom(...).

The client creates a SOCK_DGRAM internet socket,
enables broadcast option for this socket, binds it to an
available port nb, and sends a message to the server
using sendto(...).

If I specify in the sendto function the excplicit IP address
of the server, the server receives the message. If I
specify 255.255.255.255 (is this the correct broadcast
address ?), the the server doesn't receive the message.

Could anybody send me a sample using broadcast over
UDP sockets in unix.

Thanks,
Bernard



Tue, 23 Apr 2002 03:00:00 GMT  
 Broadcast over UDP socket
[snip]

Quote:
> Could anybody send me a sample using broadcast over
> UDP sockets in unix.

The C language itself defines no way to do this, but the experts in the

Gergo

--
Ahhhhhh... the smell of cuprinol and mahogany.  It e{*filter*}s me to...
acts of passion... acts of... ineptitude.

GU d- s:+ a--- C++>$ UL+++ P>++ L+++ E>++ W+ N++ o? K- w--- !O !M !V
PS+ PE+ Y+ PGP+ t* 5+ X- R>+ tv++ b+>+++ DI+ D+ G>++ e* h! !r !y+



Tue, 23 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Udp broadcast and 2 interfaces

2. UDP broadcasting

3. MFC & UDP Broadcast

4. Broadcasting using UDP

5. Environment for udp broadcast application

6. UDP Broadcast Message!

7. Broadcasting UDP with CAsyncSocket (MFC)

8. UDP Broadcast / Receive

9. Close a UDP socket

10. Q: Writing UDP Socket in C...

11. udp socket

 

 
Powered by phpBB® Forum Software