Skip to content

Commit

Permalink
Merge pull request #123 from issuu/andersfugmann/fix_async_file_descr…
Browse files Browse the repository at this point in the history
…iptor_type

Fix file descriptor type to be `File` and not `Socket` for async
  • Loading branch information
Leonidas-from-XIV authored Nov 1, 2022
2 parents fb97e8f + f91c7b9 commit 1f758d4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion zmq-async/src/deferred.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ module Fd = struct
type 'a t' = 'a t
type t = Fd.t
let create fd =
Fd.create (Fd.Kind.Socket `Active) fd (Base.Info.of_string "<zmq>")
(* The kind here seems not to matter much, but we should make sure
that the fd is not set into non-blocking mode, as this breaks
on s390x.
The 'File' kind avoids fd being set into non-blocking mode.
'Fd.create' also allows setting 'avoid_setting_nonblock', but
this option name is not stable across supported versions of
async_unix. *)
Fd.create Fd.Kind.File fd (Base.Info.of_string "<zmq>")

let wait_readable: t -> unit t' = fun t ->
Fd.ready_to t `Read >>= function
Expand Down

0 comments on commit 1f758d4

Please sign in to comment.