caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David Allsopp" <dra-news@metastack.com>
To: "'Paul Steckler'" <Paul.Steckler@nicta.com.au>,
	<caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] Unix.send blocks
Date: Wed, 16 Jun 2010 11:08:13 +0100	[thread overview]
Message-ID: <009101cb0d3b$d63748d0$82a5da70$@romulus.metastack.com> (raw)
In-Reply-To: <2EB36A07AAE8C44BBB1986425E7A22D0127E01BE32@atp-mbx1.in.nicta.com.au>

k/Paul Steckler wrote:
> I've written a wee Web server in OCaml that's compiled using the ocamlopt
> from the Fedora MinGW distribution of ocaml.  I'm running the server in
> Windows 7.
> 
> Sometimes after receiving several requests, the Unix.send call that sends
> a response back to a Web client just blocks.

Sounds like terminology may be getting in the way of a solution - do you
mean that the call *blocks* for a longer time than you expect then carries
on working (the usual meaning of "block" - i.e. the call to send doesn't
return until it's actually finished) or do you mean *freezes* - i.e. the
call seemingly *never* returns and so your application hangs. When this
happens on a given connection, does that prevent further connections from
working - i.e. is the entire server dead or just that one connection? 

Additionally, just applying the usual debugging principle of "simplify,
simplify and then simplify some more", why not eliminate the cross-compiler
and instead use ocamlopt directly on Windows?


David

PS Although it's not your question, why are you writing a web server?
CGI+IIS (if Windows is your target) is dead easy and if you do strictly want
your own webserver then there's one in ocamlnet (although I'm not sure if
that part works under Windows - my default compiled version of ocamlnet
2.2.9 doesn't seem to have it but that may be because by default it's not
compiled rather than that it's not possible to compile it). Given that
you've hit problems, reinventing the wheel seems potentially questionable.


      parent reply	other threads:[~2010-06-16 10:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-16  7:32 Paul Steckler
2010-06-16  8:55 ` Sylvain Le Gall
2010-06-16  9:11   ` [Caml-list] " Christoph Bauer
2010-06-16  9:46     ` Sylvain Le Gall
2010-06-16  9:08 ` [Caml-list] " Török Edwin
2010-06-16  9:49   ` Sylvain Le Gall
2010-06-16 10:08 ` David Allsopp [this message]

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='009101cb0d3b$d63748d0$82a5da70$@romulus.metastack.com' \
    --to=dra-news@metastack.com \
    --cc=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).