CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

UDP Sockets

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SeeCwriter



Joined: 18 Nov 2013
Posts: 159

View user's profile Send private message

UDP Sockets
PostPosted: Thu Mar 13, 2014 11:07 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Mar 13, 2014 11:34 am     Reply with quote

this works
Code:
UDPOpen(0, NULL,UDP_SOURCE_PORT);
SeeCwriter



Joined: 18 Nov 2013
Posts: 159

View user's profile Send private message

PostPosted: Thu Mar 13, 2014 2:36 pm     Reply with quote

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 );
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group