From 64891c28fc7b9700e049079da116278e0a94981d Mon Sep 17 00:00:00 2001 From: Clombrong Date: Sat, 28 Jun 2025 00:16:57 +0200 Subject: refactor(portal_tcp): make socket type into a variant --- portal/tcp/portal.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/portal/tcp/portal.ml b/portal/tcp/portal.ml index c558888..73321bd 100644 --- a/portal/tcp/portal.ml +++ b/portal/tcp/portal.ml @@ -1,7 +1,7 @@ open Lwt.Syntax open Markup -type socket = Lwt_unix.file_descr +type socket = Plain of Lwt_unix.file_descr type t = { mutable stream : (signal, async) stream; @@ -72,7 +72,7 @@ let tcp_socket (domain : string) : Lwt_unix.file_descr Lwt.t = (** [socket_to_stream sock] is a [stream, push] tuple wrapping the Unix socket [sock] in Markup signals. *) -let socket_to_stream (sock : socket) = +let socket_to_stream (sock : Lwt_unix.file_descr) = let raw_stream = let recv_bytes = Bytes.create 4096 in Lwt_stream.from (fun () -> @@ -126,4 +126,4 @@ let socket_to_stream (sock : socket) = let connect (domain : string) : t Lwt.t = let+ _socket = tcp_socket domain in let stream, push = socket_to_stream _socket - in {stream; push; _socket} + in {stream; push; _socket=Plain _socket} -- cgit v1.2.3