Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec accept_connection sock =
- let socket_thread = Lwt_unix.accept sock in
- Lwt.bind socket_thread
- ( fun (fd, caller) ->
- ignore(Lwt_io.printf "accepted\n%!");
- readall fd >>= fun a -> Lwt_io.printf "readall result\n %s\n%!" a >>= fun () -> Lwt_unix.close fd
- accept_connection sock;
- );;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement