Networking Forums

Networking Forums > Computer Networking > Linux Networking > recvfrom() unblocking.. how to do it?

Reply
Thread Tools Display Modes

recvfrom() unblocking.. how to do it?

 
 
manu
Guest
Posts: n/a

 
      04-21-2006, 05:05 PM
hi experts,
i am trying to unblock the recvfrom(), which is getting blocked coz its
not recieving any data..
i tried to use signal call on SIGHUP but its not working.. plzz help
waiting for u r reply.
Manohar.S

 
Reply With Quote
 
 
 
 
Rick Jones
Guest
Posts: n/a

 
      04-21-2006, 05:54 PM
manu <(E-Mail Removed)> wrote:

> i am trying to unblock the recvfrom(), which is getting blocked coz its
> not recieving any data..
> i tried to use signal call on SIGHUP but its not working.. plzz help
> waiting for u r reply.


How about adding a call to select() or poll() with a suitable timeout?


--
No need to believe in either side, or any side. There is no cause.
There's only yourself. The belief is in your own precision. - Jobert
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
Phil Frisbie, Jr.
Guest
Posts: n/a

 
      04-21-2006, 06:23 PM
Rick Jones wrote:

> manu <(E-Mail Removed)> wrote:
>
>
>>i am trying to unblock the recvfrom(), which is getting blocked coz its
>>not recieving any data..
>>i tried to use signal call on SIGHUP but its not working.. plzz help
>>waiting for u r reply.

>
>
> How about adding a call to select() or poll() with a suitable timeout?


And don't forget to make the socket non-blocking

--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      04-21-2006, 06:44 PM
Phil Frisbie, Jr. <(E-Mail Removed)> wrote:
>> How about adding a call to select() or poll() with a suitable timeout?


> And don't forget to make the socket non-blocking


Outside of two or more processes/threads select()ing on the same
socket, is that really necessary? Will select() return the socket as
being readable when it really isn't?

rick jones
--
Process shall set you free from the need for rational thought.
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
Phil Frisbie, Jr.
Guest
Posts: n/a

 
      04-21-2006, 08:12 PM
Rick Jones wrote:

> Phil Frisbie, Jr. <(E-Mail Removed)> wrote:
>
>>>How about adding a call to select() or poll() with a suitable timeout?

>
>>And don't forget to make the socket non-blocking

>
> Outside of two or more processes/threads select()ing on the same
> socket, is that really necessary?


For defensive programming it is...

> Will select() return the socket as
> being readable when it really isn't?


Not according to to the Single UNIX Specification Version 3, but there are other
unmentionable OSs that might block.

Also, generally you would loop and read all available data before you blocked on
select() again, so you would need the socket to be non-blocking to look for the
EWOULDBLOCK error.

> rick jones


--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket: recvfrom sathya Linux Networking 1 05-07-2009 01:08 PM
Blocking (and unblocking) websites through your own router some_guy334 Broadband Hardware 1 11-16-2006 02:42 AM
problem with recvfrom Omega Linux Networking 0 11-21-2005 08:17 PM
Unblocking Ports Seth J. Broadband Hardware 1 01-21-2004 01:29 AM
unblocking ntp on rh9 jbailo Linux Networking 2 10-30-2003 05:33 PM



1 2 3 4 5 6 7 8 9 10 11