kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: "Iñaki Baz Castillo" <ibc@aliax.net>
To: kgio@librelist.com
Subject: kgio_trywrite raises "Broken pipe - send (Errno::EPIPE)"
Date: Tue, 10 Apr 2012 01:00:24 +0200	[thread overview]
Message-ID: <CALiegfmQArNQ7cYDU5aE5iATNgtzz7gQaJjuASZnEnfjp=RyRQ@mail.gmail.com> (raw)
In-Reply-To: <CALiegfmQArNQ7cYDU5aE5iATNgtzz7gQaJjuASZnEnfjp=RyRQ@mail.gmail.com>

Hi, I've realized that in certain cases Kgio::TCPSocket#kgio_trywrite
raises a "Broken pipe - send (Errno::EPIPE)" exception.

In my test case, I use Kgio::TCPSocket within EventMachine (using
EM.watch and so).

- Open the connection (*persistent* connection).

- Send a SIP request (like HTTP) to my custom server which replies a
SIP response.

- When "any data" is received (maybe not the entire SIP response since
I use kgio_tryread(40) for testing purposes) I send a *new* SIP
request.

- This means that, at some point, I send much more data than the received one.

- If when reading the received data with kgio_tryread(XXX), XXX is
equal or greater than the SIP response size, then there is no issue
and it works forever.

- But if XXX is less that the SIP response size, then at some point I
get an exception when calling to  Kgio::TCPSocket#kgio_trywrite:

    "Broken pipe - send (Errno::EPIPE)"


I assume this is since the TCP buffer is filled due to the above
"strange" test case. So I wonder, shouldn't kgio_trywrite return
:error_epipe? :)

-- 
Iñaki Baz Castillo
<ibc@aliax.net>

       reply	other threads:[~2012-04-09 23:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09 23:00 Iñaki Baz Castillo [this message]
2012-04-09 23:22 ` kgio_trywrite raises "Broken pipe - send (Errno::EPIPE)" Iñaki Baz Castillo
2012-04-10 20:15 ` Eric Wong
2012-04-10 20:56   ` Iñaki Baz Castillo

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

  List information: https://yhbt.net/kgio/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALiegfmQArNQ7cYDU5aE5iATNgtzz7gQaJjuASZnEnfjp=RyRQ@mail.gmail.com' \
    --to=ibc@aliax.net \
    --cc=kgio@librelist.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.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kgio.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).