* [Caml-list] nonblock socket in Windows
@ 2011-08-31 10:55 Vu Ngoc San
2011-08-31 11:05 ` Gerd Stolpmann
0 siblings, 1 reply; 3+ messages in thread
From: Vu Ngoc San @ 2011-08-31 10:55 UTC (permalink / raw)
To: OCaml List
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"
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] nonblock socket in Windows
2011-08-31 10:55 [Caml-list] nonblock socket in Windows Vu Ngoc San
@ 2011-08-31 11:05 ` Gerd Stolpmann
2011-08-31 12:09 ` Vu Ngoc San
0 siblings, 1 reply; 3+ messages in thread
From: Gerd Stolpmann @ 2011-08-31 11:05 UTC (permalink / raw)
To: Vu Ngoc San; +Cc: OCaml List
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.
------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] nonblock socket in Windows
2011-08-31 11:05 ` Gerd Stolpmann
@ 2011-08-31 12:09 ` Vu Ngoc San
0 siblings, 0 replies; 3+ messages in thread
From: Vu Ngoc San @ 2011-08-31 12:09 UTC (permalink / raw)
To: Gerd Stolpmann; +Cc: OCaml List
that's good news for me, thanks ! I'm going to try.
Maybe the ocaml manual could be updated on this point.
San
Le mercredi 31 août 2011 13:05:00, Gerd Stolpmann a écrit :
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-31 12:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-31 10:55 [Caml-list] nonblock socket in Windows Vu Ngoc San
2011-08-31 11:05 ` Gerd Stolpmann
2011-08-31 12:09 ` Vu Ngoc San
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox