From: Nick Palmer <nick@sluggardy.net>
To: Alex Riesen <fork0@users.sourceforge.net>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, netdev@oss.sgi.com
Subject: Re: select implementation not POSIX compliant?
Date: Fri, 13 Aug 2004 13:12:56 -0700 [thread overview]
Message-ID: <411D20C8.1080400@sluggardy.net> (raw)
In-Reply-To: <20040811194018.GA3971@steel.home>
Alex Riesen wrote:
> On linux-kernel, Nick Palmer wrote:
>>The application
>>expects that a close call on a socket that another thread is
>>blocking in select and/or recvmsg on will cause select and/or
>>recvmsg to return with an error. Linux does not seem to do this.
>
>
> It works always for stream sockets and does not at all (even with
> shutdown, even using poll(2) or read(2) instead of select) for dgram
> sockets.
>
> What domain (inet, local) are your sockets in?
inet.
> What type (stream, dgram)?
We use both, though the breakage I was trying to fix was with a dgram
socket.
You are correct that it does not work for dgram sockets at all! I had
not noticed the difference between the two in the test case I wrote,
since I hadn't tested streams. Thanks for pointing that out. Note that
shutdown will cause a dgram socket to exit from a recv* call though, as
this is the workaround I am using right now. On Solaris close will do
the job. However when the recv from ends it returns 0, but does not set
errno, which indicates that there may be more data that can be retrieved
with another call to recv. On Solaris both shutdown and close cause
errno to be set.
There is no way then to cause a select on a dgram socket to break out at
all short of kludging some dgram packet transmission to cause it to happen.
Yech!
Thanks for looking into the issue more,
-Nick
prev parent reply other threads:[~2004-08-13 20:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <37062.66.93.180.209.1092243659.squirrel@66.93.180.209>
2004-08-11 19:40 ` select implementation not POSIX compliant? Alex Riesen
2004-08-11 20:33 ` khandelw
2004-08-11 21:23 ` Alex Riesen
2004-08-13 20:13 ` Nick Palmer
2004-08-11 21:57 ` Steven Dake
2004-08-13 20:12 ` Nick Palmer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=411D20C8.1080400@sluggardy.net \
--to=nick@sluggardy.net \
--cc=fork0@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).