caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Paul Steckler <Paul.Steckler@nicta.com.au>
To: "caml-list@yquem.inria.fr" <caml-list@yquem.inria.fr>
Subject: [Caml-list] Re: Unix.send blocks
Date: Thu, 17 Jun 2010 11:30:40 +1000	[thread overview]
Message-ID: <2EB36A07AAE8C44BBB1986425E7A22D0127E01BE33@atp-mbx1.in.nicta.com.au> (raw)

I wrote:

> Sometimes after receiving several requests, the Unix.send call that sends a response
> back to a Web client just blocks.  The send buffer is pretty large (64k), and the data
> to be sent is always much less than that.

I've found a solution.  When receiving data from the browser, the socket only ever
made one call to Unix.recv, even if there was more data available, because in this
application, that was always enough.  That strategy must have left some internal
buffers filled in the socket implementation.  When I allow multiple calls to Unix.recv,
until all data has been received, all calls to Unix.send proceed.

Re the issue of multi-threadedness, I'm unable to build a multi-threaded OCaml
application using the Fedora distribution of the MingGW build, for reasons I
mentioned in an earlier message to this list.  A non-blocking socket wouldn't
have helped in this situation, anyway, because the blocking status of the socket
wasn't the issue.

-- Paul
--
Paul Steckler
National ICT Australia
paul DOT steckler AT nicta.com.au

The information in this e-mail may be confidential and subject to legal professional privilege and/or copyright. National ICT Australia Limited accepts no liability for any damage caused by this email or its attachments.


             reply	other threads:[~2010-06-17  1:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17  1:30 Paul Steckler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-16  7:32 Paul Steckler
2010-06-16  8:55 ` Sylvain Le Gall
2010-06-16  9:11   ` [Caml-list] " Christoph Bauer

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=2EB36A07AAE8C44BBB1986425E7A22D0127E01BE33@atp-mbx1.in.nicta.com.au \
    --to=paul.steckler@nicta.com.au \
    --cc=caml-list@yquem.inria.fr \
    /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).