caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Julien Boulnois <jboulnois@rashitoul.net>
To: caml-list@yquem.inria.fr
Subject: Socket and Threads on windows
Date: Mon,  7 Feb 2005 09:41:40 +0100	[thread overview]
Message-ID: <1107765700-e20070018019e5a283e3267b340928dc@rashitoul.net> (raw)

Hi,

I try to use socket and threads for a receiving/sending client. My code works fine on linux but seems to block the whole program on windows ...

It looks like this:

***

let sock=Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0;;

(* sock connection ... *)

let (ic,oc)=(Unix.in_channel_of_descr sock,Unix.out_channel_of_descr sock);;

let my_receive()=
  let d=input_value ic in
 (* data utilisation ... *)
;;
let my_send d=
  output_value oc d;;

let run()=
 while true do
  my_receive()
 done;;

let t=Thread.create (fun()->run()) ();;

(* ... *)

***

Now when I try to send data with my_send, the program just block and nothing more happen ...

I want to know if it exists some issue on windows for this case.

Thanks.

Julien Boulnois





             reply	other threads:[~2005-02-07  8:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-07  8:41 Julien Boulnois [this message]
2005-02-07 10:33 ` [Caml-list] " Olivier Pérès
2005-02-07 11:05   ` Julien Boulnois
2005-02-10 16:23     ` OCAML Newby Question: unbound module? Juancarlo Añez
2005-02-11 14:45       ` [Caml-list] " John Prevost

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=1107765700-e20070018019e5a283e3267b340928dc@rashitoul.net \
    --to=jboulnois@rashitoul.net \
    --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).