Advertisement
Guest User

Untitled

a guest
Dec 19th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. let rec accept_connection sock =
  2. let socket_thread = Lwt_unix.accept sock in
  3. Lwt.bind socket_thread
  4. ( fun (fd, caller) ->
  5. ignore(Lwt_io.printf "accepted\n%!");
  6. readall fd >>= fun a -> Lwt_io.printf "readall result\n %s\n%!" a >>= fun () -> Lwt_unix.close fd
  7. accept_connection sock;
  8. );;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement