[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recv blocks forever after close

From: Dan Kegel
Subject: Re: Recv blocks forever after close
Date: Wed, 18 Jun 2003 10:21:39 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020615 Debian/1.0.0-3

Ignasi Villagrasa wrote:
I'm developing a multi-threaded server based application and I've noticed a problem when closing a socket file descriptor from a thread and the corresponding recv socket function is running in other thread. Instead of returning, as documented, the function remains locked.

I'm using Red Hat 7.2, and my program uses pthreads.

I have found the same problem in


two years ago. But this question has no reply.

My impression is that this is by design in Linux.
See for example

Try calling shutdown() before close(), that will probably fix it for you.
- Dan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]