LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   UDP and select() confusion (https://www.linuxquestions.org/questions/programming-9/udp-and-select-confusion-75730/)

Pres 07-25-2003 01:26 AM

UDP and select() confusion
 
Somewhere here I am not thinking straight :

I can't use select() in a connectionless situation, that is, where I am using recvfrom() and sendto(), at least not in a way that does any good

If I use connected datagram sockets the first client to connect() will hog the server since the server's fd is "taken"

So, what to do ? Use non-blocking sockets and a timer ?

TheLinuxDuck 07-25-2003 11:58 AM

http://unlser1.unl.csi.cuny.edu/faqs...ket-faq-5.html

The site is a good socket reference:
http://unlser1.unl.csi.cuny.edu/faqs...ocket-faq.html

Another great socket reference guide:
http://www.ecst.csuchico.edu/~beej/guide/net/

Pres 07-26-2003 12:18 AM

Re: UDP and select() confusion
 
Quote:

Originally posted by Pres
Somewhere here I am not thinking straight :

I can't use select() in a connectionless situation, that is, where I am using recvfrom() and sendto(), at least not in a way that does any good


Select can be used.

Here's where my thinking was flawed, I thought that recvfrom() specified exactly from who you will recieve !! Lo and behold, it just pulls in a packet then tells you who it's from so that is much easier. Problem solved.


All times are GMT -5. The time now is 06:36 PM.