Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Re: Unix.send blocks
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Paul Steckler <Paul.Steckler@n...>
Subject: [Caml-list] Re: Unix.send blocks
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.