···6868 | Socketpair_datagram : Switch.t * Unix.socket_domain * int ->
6969 ([`Unix_fd | datagram_socket_ty] r * [`Unix_fd | datagram_socket_ty] r) Effect.t
70707171-let open_stream s = (s : _ stream_socket :> [< `Unix_fd | stream_socket_ty] r)
7272-let open_listening s = (s : _ listening_socket :> [< `Unix_fd | listening_socket_ty] r)
7373-let open_datagram s = (s : _ datagram_socket :> [< `Unix_fd | datagram_socket_ty] r)
7171+let open_stream s = (s : [`Unix_fd | stream_socket_ty] r :> [< `Unix_fd | stream_socket_ty] r)
7272+let open_listening s = (s : [`Unix_fd | listening_socket_ty] r :> [< `Unix_fd | listening_socket_ty] r)
7373+let open_datagram s = (s : [`Unix_fd | datagram_socket_ty] r :> [< `Unix_fd | datagram_socket_ty] r)
74747575let import_socket_stream ~sw ~close_unix fd =
7676 open_stream @@ Effect.perform (Import_socket_stream (sw, close_unix, fd))
···8686 (open_stream a, open_stream b)
87878888let socketpair_datagram ~sw ?(domain=Unix.PF_UNIX) ?(protocol=0) () =
8989- Effect.perform (Socketpair_datagram (sw, domain, protocol))
8989+ let a, b = Effect.perform (Socketpair_datagram (sw, domain, protocol)) in
9090+ (open_datagram a, open_datagram b)
90919192let fd socket =
9293 Option.get (Resource.fd_opt socket)
+5-5
vendor/opam/eio/lib_eio/unix/net.mli
···55555656(** {2 Creating or importing sockets} *)
57575858-val import_socket_stream : sw:Switch.t -> close_unix:bool -> Unix.file_descr -> [`Unix_fd | stream_socket_ty] r
5858+val import_socket_stream : sw:Switch.t -> close_unix:bool -> Unix.file_descr -> [< `Unix_fd | stream_socket_ty] r
5959(** [import_socket_stream ~sw ~close_unix fd] is an Eio flow that uses [fd].
60606161 It can be cast to e.g. {!source} for a one-way flow.
···63636464 The [close_unix] and [sw] arguments are passed to {!Fd.of_unix}. *)
65656666-val import_socket_listening : sw:Switch.t -> close_unix:bool -> Unix.file_descr -> [`Unix_fd | listening_socket_ty] r
6666+val import_socket_listening : sw:Switch.t -> close_unix:bool -> Unix.file_descr -> [< `Unix_fd | listening_socket_ty] r
6767(** [import_socket_listening ~sw ~close_unix fd] is an Eio listening socket that uses [fd].
68686969 The socket object will be closed when [sw] finishes.
70707171 The [close_unix] and [sw] arguments are passed to {!Fd.of_unix}. *)
72727373-val import_socket_datagram : sw:Switch.t -> close_unix:bool -> Unix.file_descr -> [`Unix_fd | datagram_socket_ty] r
7373+val import_socket_datagram : sw:Switch.t -> close_unix:bool -> Unix.file_descr -> [< `Unix_fd | datagram_socket_ty] r
7474(** [import_socket_datagram ~sw ~close_unix fd] is an Eio datagram socket that uses [fd].
75757676 The socket object will be closed when [sw] finishes.
···8282 ?domain:Unix.socket_domain ->
8383 ?protocol:int ->
8484 unit ->
8585- [`Unix_fd | stream_socket_ty] r * [`Unix_fd | stream_socket_ty] r
8585+ [< `Unix_fd | stream_socket_ty] r * [< `Unix_fd | stream_socket_ty] r
8686(** [socketpair_stream ~sw ()] returns a connected pair of flows, such that writes to one can be read by the other.
87878888 This creates OS-level resources using [socketpair(2)].
···9393 ?domain:Unix.socket_domain ->
9494 ?protocol:int ->
9595 unit ->
9696- [`Unix_fd | datagram_socket_ty] r * [`Unix_fd | datagram_socket_ty] r
9696+ [< `Unix_fd | datagram_socket_ty] r * [< `Unix_fd | datagram_socket_ty] r
9797(** [socketpair_datagram ~sw ()] returns a connected pair of flows, such that writes to one can be read by the other.
98989999 This creates OS-level resources using [socketpair(2)].