caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Vu Ngoc San <san.vu-ngoc@laposte.net>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] nonblock socket in Windows
Date: Wed, 31 Aug 2011 13:05:00 +0200	[thread overview]
Message-ID: <1314788700.3496.213.camel@thinkpad> (raw)
In-Reply-To: <201108311255.19184.san.vu-ngoc@laposte.net>

Am Mittwoch, den 31.08.2011, 12:55 +0200 schrieb Vu Ngoc San:
> Hello
> 
> I want to have non-blocking sockets for a UDP client/server.  I use
> the Unix.set_nonblock which works fine in Linux, but the manual tells
> me that in Windows (Win32):
> 
> "set_nonblock, clear_nonblock	implemented as dummy functions; use threads 
> instead of non-blocking I/O"

This is only partially correct. Non-blocking sockets are implemented,
and these functions work in Ocaml. For other types of file descriptors,
Windows doesn't provide non-blocking access.

Gerd

> 
> I would like to avoid threads, and on the other hand there is the
> ioctlsocket function in Windows which seems to do it. So why isn't
> this implemented in ocaml ?
> 
> http://msdn.microsoft.com/en-us/library/ms738573
> 
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
Creator of GODI and camlcity.org.
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
*** Searching for new projects! Need consulting for system
*** programming in Ocaml? Gerd Stolpmann can help you.
------------------------------------------------------------


  reply	other threads:[~2011-08-31 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31 10:55 Vu Ngoc San
2011-08-31 11:05 ` Gerd Stolpmann [this message]
2011-08-31 12:09   ` Vu Ngoc San

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=1314788700.3496.213.camel@thinkpad \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=san.vu-ngoc@laposte.net \
    /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).