English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] Re: Select on channels (again)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-08-23 (08:29)
From: Christoph Bauer <christoph.bauer@l...>
Subject: Re: [Caml-list] Re: Select on channels (again)

> > ...
> > I did this, but on windows with two programs communicating 
> over a pipe 
> > this isn't enough. select on windows and on a pipe doesn't work. 
> > Therefore I wrote a stub for PeekNamedPipe():
> "Select on windows" certainly does work... and why not use a 
> socket pair, just as one might on a *nix system?  That way, 
> it will work on both.

Select doesn't work on window pipes. In retrospect sockects
would be the better choice. I stumbled in a strange dead lock
with theses pipes, because under windows the pipe buffer
is set to 1024 bytes (otherlibs/win32unix/pipe.c) and will then
block til the reader reads the contents. IMO this
value (SIZEBUF) should be zero to let the system choose the best
buffer size. [1] 

> And the fact that socketpair has been left out of the Windows 
> version of the Unix module is not an impediment - it is easy 
> to write a useful implementation in OCaml (I can supply one 
> if needed).

Please supply one.

Christoph Bauer