LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-25-2003, 01:26 AM   #1
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Rep: Reputation: 30
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 ?
 
Old 07-25-2003, 11:58 AM   #2
TheLinuxDuck
Member
 
Registered: Sep 2002
Location: Tulsa, OK
Distribution: Slack, baby!
Posts: 349

Rep: Reputation: 33
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/
 
Old 07-26-2003, 12:18 AM   #3
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Original Poster
Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP/UDP Confusion blackhole123 Linux - Networking 1 11-15-2005 03:46 AM
Select() did not select my socket thvo Programming 1 05-08-2005 12:20 AM
RFC 868 udp 37 time-udp gpl SUSE / openSUSE 2 03-31-2005 10:07 AM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM
sockets, UDP, using select() Pres Programming 3 08-22-2003 09:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration