C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 07-23-2006, 05:42 AM   #1
l2u
Registered User
 
Join Date: May 2006
Posts: 630
udp non-blocking sockets

Hello..

Im working on udp non-blocking socket. I looked around but I couldnt find any good article or example on it.. How do I have to set udp socket to non-blocking?

Thanks
l2u is offline   Reply With Quote
Old 07-23-2006, 06:20 AM   #2
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,691
Code:
       It is possible to do non-blocking IO on sockets by setting the O_NONBLOCK flag on a
       socket file descriptor using fcntl(2).  Then all operations that would  block  will
       (usually)  return  with EAGAIN (operation should be retried later); connect(2) will
       return EINPROGRESS error.  The user can then wait for various events via poll(2) or
       select(2).
Well if you're using Linux anyway.

If you're on fairly broken windows, you'd better say so.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.

Salem is offline   Reply With Quote
Old 07-23-2006, 06:59 AM   #3
l2u
Registered User
 
Join Date: May 2006
Posts: 630
Im on windows.
l2u is offline   Reply With Quote
Old 08-07-2006, 06:57 PM   #4
Registered User
 
Join Date: Aug 2002
Location: Hermosa Beach, CA
Posts: 446
You could try ACE library, which is a portable network library:

http://www.cs.wustl.edu/~schmidt/ACE.html
__________________
The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.
IfYouSaySo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pros and Cons of blocking versus non-blocking sockets? abachler Networking/Device Communication 4 05-08-2008 06:52 AM
Sockets and UDP problem ally153 C Programming 5 03-20-2006 05:19 AM
multiple UDP sockets with select() nkhambal Networking/Device Communication 2 01-17-2006 07:36 PM
Problems with UDP sockets majoub Networking/Device Communication 9 04-30-2005 12:25 AM
Non blocking sockets osal Networking/Device Communication 3 07-23-2004 06:16 PM


All times are GMT -6. The time now is 03:04 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22