Mark Li <
mar...@gmail.com> writes:
> 1.
> 1) For Tcp.Server.create and Tcp.with_connection, I think I need to close
> underlying file descriptor manually?
From the documentation (emphasis mine):
with_connection ~host ~port f looks up host from a string (using DNS as
needed), connects, then calls f, passing the connected socket and a
reader and writer for it. When the deferred returned by f is determined,
or any exception is thrown, _the socket, reader and writer are closed_.
And for [Tcp.Server.create]:
If the deferred returned by handler is ever determined, or handler
raises an exception, then _reader and writer are closed_.
https://ocaml.janestreet.com/ocaml-core/111.28.00/doc/async/#Std.Tcp