caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Socket and Threads on windows
@ 2005-02-07  8:41 Julien Boulnois
  2005-02-07 10:33 ` [Caml-list] " Olivier Pérès
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Boulnois @ 2005-02-07  8:41 UTC (permalink / raw)
  To: caml-list

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-11 14:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-07  8:41 Socket and Threads on windows Julien Boulnois
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

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).