View previous topic :: View next topic |
Author |
Message |
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
UDP Sockets |
Posted: Thu Mar 13, 2014 11:07 am |
|
|
I want to open a UDP socket to listen for UDP Broadcast datagrams.
I'm looking at the description of function UDPOpenEx() in UDP.c as well as Ethernet example program ex12.c.
UDPOpenEx() takes 4-arguments, but the example program only provides 3. And it's not clear which 3. From ex12.c:
Code: | socket[i]=UDPOpen(UDP_SOURCE_PORT,NULL,INVALID_UDP_SOCKET);
|
I have a specific port number I want listen on. Other than that, all other parameters are unknown. I need to accept a broadcast datagram from any client.
I'm looking for suggestions on what arguments to use to open the socket. |
|
|
fr3nsis
Joined: 13 May 2013 Posts: 10
|
|
Posted: Thu Mar 13, 2014 11:34 am |
|
|
this works
Code: | UDPOpen(0, NULL,UDP_SOURCE_PORT); |
|
|
|
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
|
Posted: Thu Mar 13, 2014 2:36 pm |
|
|
The following seems more correct to me. I want to listen for broadcasts on a specific port, and I don't care what port the client uses. Does this seem correct?
Code: | my_socket = udp_extopen( UDP_BROADCAST_PORT, NULL, 0 ); |
|
|
|
|