Showing content from https://github.com/ocsigen/lwt/issues/829 below:
Lwt_io.establish_server_generic doesn't handle ECONNABORTED · Issue #829 · ocsigen/lwt · GitHub
I have been running an opium server on FreeBSD, and it failed with ECONNABORTED
in Lwt_unix.accept
. It seems Lwt_io.establish_server_generic
doesn't handle this error as well.
let rec accept_loop () = let try_to_accept = Lwt_unix.accept listening_socket >|= fun x -> `Accepted x in Lwt.pick [try_to_accept; should_stop] >>= function | `Accepted (client_socket, client_address) -> begin try Lwt_unix.set_close_on_exec client_socket with Invalid_argument _ -> () end; connection_handler_callback client_address client_socket; accept_loop () | `Should_stop -> Lwt_unix.close listening_socket >>= fun () -> begin match listening_address with | Unix.ADDR_UNIX path when path <> "" && path.[0] <> '\x00' -> Unix.unlink path | _ -> () end [@ocaml.warning "-4"]; Lwt.wakeup_later notify_listening_socket_closed (); Lwt.return_unit in
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4