caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Re: Unix.send blocks
@ 2010-06-17  1:30 Paul Steckler
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Steckler @ 2010-06-17  1:30 UTC (permalink / raw)
  To: caml-list

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [Caml-list] Re: Unix.send blocks
  2010-06-16  8:55 ` Sylvain Le Gall
@ 2010-06-16  9:11   ` Christoph Bauer
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Bauer @ 2010-06-16  9:11 UTC (permalink / raw)
  To: caml-list

 
> While it's easy to reproduce the error (a certain pattern of requests 
> from the browser), I can't tell what particular conditions cause the blocking behavior.
>
> Any help appreciated.

I guess you are using Unix.select. There is (was) a bug in the windows
select implementation. It had problems with the GC.

http://caml.inria.fr/mantis/view.php?id=4844

Just an idea.

Christoph Bauer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-17  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-17  1:30 [Caml-list] Re: Unix.send blocks Paul Steckler
  -- 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

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).