Networking Forums

Networking Forums > Computer Networking > Linux Networking > select with timeout hangs when socket is closed

Reply
Thread Tools Display Modes

select with timeout hangs when socket is closed

 
 
eran borovik
Guest
Posts: n/a

 
      10-19-2004, 03:54 PM
Hi, my process is multithreaded and uses tcp/ip.
When I close a socket I encounter the problem that the thread blocking
on select hangs forever. This is really strange because the thread
uses a one second timeout on select. Whenever the socket is alive, and
the timeout expires
the select returns appropriately. However if the socket is closed
(From another thread) select hangs and never returns. When tried the
same on solaris, the select call didn't hang
What can be the trouble?
I thought that perhaps signal blocking somehow caused the deadlock so
I reset the signal mask of the thread but to no avail.
This happens on a RH Advances server 3 kernel 2.4.21-4 machine.

Can someone please explain the problem.

Regards.
ERAN
 
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
threading issue : SIGPIPE => SIG_IGN (writing to closed socket) Oliver Kowalke Linux Networking 0 12-30-2006 09:34 AM
select() returns and indicates writability before a non-blocking TCP socket has actually connected. jaswantv@nortelnetworks.com Linux Networking 0 10-25-2006 04:09 PM
How to find UDP socket is closed in client and server program in C sandeep Linux Networking 1 09-22-2006 12:18 PM
select() waiting for timeout before doing anything Frank de Bot Linux Networking 3 12-07-2004 08:05 PM
2.2 select() on UDP Socket doesn't work as expected rs Linux Networking 0 07-08-2003 09:52 AM



1 2 3 4 5 6 7 8 9 10 11