Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion zmq-deferred/src/socket.ml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ module Make(T: Deferred.T) = struct
event_loop t
| exception Unix.Unix_error(Unix.ENOTSOCK, "zmq_getsockopt", "") ->
Deferred.return ()
| exception Unix.Unix_error(Unix.EINTR, "zmq_getsockopt", "") ->
Format.eprintf "DEBUG: ZMQ-lwt: Got EINTR in event-loop - retrying..\n%!";
event_loop t
end

let of_socket: ('a Zmq.Socket.t -> 'a t) of_socket_args = fun socket ->
Expand All @@ -163,9 +166,12 @@ module Make(T: Deferred.T) = struct
let f' mailbox () =
let res = match f t.socket with
| v -> Ok v
| exception Unix.Unix_error (Unix.EAGAIN, _, _) ->
| exception Unix.Unix_error (Unix.EAGAIN, _, _) ->
(* Signal try again *)
raise Retry
| exception Unix.Unix_error (Unix.EINTR, "zmq_msg_recv", _) ->
Format.eprintf "DEBUG: ZMQ-lwt: Got EINTR from 'zmq_msg_recv' - retrying..\n%!";
raise Retry
| exception exn -> Error exn
in
Mailbox.send mailbox res
Expand Down