Skip to content

Commit

Permalink
Merge pull request mirage#75 from lnmx/fix-accept
Browse files Browse the repository at this point in the history
move listen_tcpv4 callback to an async thread
  • Loading branch information
avsm committed Nov 2, 2014
2 parents 8c8770b + 9272ffc commit 8acbaed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions unix/tcpip_stack_socket.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ module Make(Console:V1_LWT.CONSOLE) = struct
if true then loop () else return_unit in
Lwt_unix.accept fd
>>= fun (afd, _) ->
Lwt.catch
(fun () -> callback afd)
(fun _ -> return_unit)
Lwt.async (fun () ->
Lwt.catch
(fun () -> callback afd)
(fun _ -> return_unit)
);
return_unit
>>= fun () ->
continue ();
in
Expand Down

0 comments on commit 8acbaed

Please sign in to comment.