Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
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: David Allsopp <dra-news@m...>
Subject: RE: [Caml-list] Unix.send blocks
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?


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.