Version française
Home     About     Download     Resources     Contact us    
Browse thread
Socket and Threads on windows
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Julien Boulnois <jboulnois@r...>
Subject: Socket and Threads on windows
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