From: Andi Kleen <ak@suse.de>
To: Adam Scislowicz <adams@fourelle.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Non-Blocking socket (SOCK_STREAM send)
Date: Fri, 15 Dec 2000 00:20:32 +0100 [thread overview]
Message-ID: <20001215002032.A24018@gruyere.muc.suse.de> (raw)
In-Reply-To: <3A3953DB.CDA2DF4E@fourelle.com>
In-Reply-To: <3A3953DB.CDA2DF4E@fourelle.com>; from adams@fourelle.com on Thu, Dec 14, 2000 at 03:12:27PM -0800
On Thu, Dec 14, 2000 at 03:12:27PM -0800, Adam Scislowicz wrote:
> Could someone explain why send is failing with EPIPE on the 2.4.x
> kernel, while it is working with the 2.2.x kernels.
>
> The PsuedoCode:
> sock = socket(AF_INET, SOCK_STREAM, 0)
> buf = fcntl(sock, F_GETFL)
> fcntl(sock, F_SETFL, buf | O_NONBLOCK) // we check the SETFL return
> value, it succeeds
> while ((retval = connect(sock, addr, sizeof(struct sockaddr_in))) < 0)
> {
> if (retval < 0) {
> if (errno != EINPROGRESS) return -1; // return failure
> }
> } // the connect succeeds during first iteration with return value of 0.
>
> send(sock, msg, msg_length, 0) // this connection is to the thttpd web
> server on the same host. XXX
> XXX: send fails with EPIPE on the 2.4.0-test11-ac 4 and 2.4.0-test12
> kernels, whereas it does not fail on 2.2.14-5.0(redhat kernel)
EPIPE means that the other end or you have closed the connection. It has nothing
to do with the socket's non blockingness.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-12-14 23:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-14 23:12 Adam Scislowicz
2000-12-14 23:20 ` Andi Kleen [this message]
2000-12-14 23:26 ` Adam Scislowicz
2000-12-14 23:35 ` Andi Kleen
2000-12-14 23:54 ` Adam Scislowicz
2000-12-15 0:03 ` Andi Kleen
2000-12-15 22:10 ` Non-Blocking socket (SOCK_STREAM send) - SOLVED Adam Scislowicz
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=20001215002032.A24018@gruyere.muc.suse.de \
--to=ak@suse.de \
--cc=adams@fourelle.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®