Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let echo ic oc =
- let char_stream = ref None in
- let t = Lwt_timeout.create 10 begin fun () ->
- (match !char_stream with
- | None -> log_info_bad "this is bad"
- | Some c ->
- Lwt_io.write_chars oc c)
- |> Lwt.ignore_result
- end
- in
- Lwt_timeout.start t;
- Lwt.return (char_stream := Some (Lwt_io.read_chars ic))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement