Ocaml 使用cohttp库(或其他)的持久HTTP连接

Ocaml 使用cohttp库(或其他)的持久HTTP连接,ocaml,Ocaml,似乎(基于wireshark),cohttp客户端在收到GET请求响应后自动关闭连接。 有没有办法使此连接保持活动状态(使其持久化)? 如果没有,是否还有其他HTTP库可以创建持久连接?查看下面的代码,似乎没有这样的选项 let call ?(ctx=default_ctx) ?headers ?(body=`Empty) ?chunked meth uri = ... Net.connect_uri ~ctx uri >>= fun (conn, ic, oc) ->

似乎(基于wireshark),cohttp客户端在收到GET请求响应后自动关闭连接。
有没有办法使此连接保持活动状态(使其持久化)?
如果没有,是否还有其他HTTP库可以创建持久连接?

查看下面的代码,似乎没有这样的选项

let call ?(ctx=default_ctx) ?headers ?(body=`Empty) ?chunked meth uri =
  ...
  Net.connect_uri ~ctx uri >>= fun (conn, ic, oc) ->
  let closefn () = Net.close ic oc in
  ...
  read_response ~closefn ic oc meth
其中,
读取响应
为:

let read_response ~closefn ic oc meth =
  ...
   match has_body with
    | `Yes | `Unknown ->
      let reader = Response.make_body_reader res ic in
      let stream = Body.create_stream Response.read_body_chunk reader in
      let closefn = closefn in
      Lwt_stream.on_terminate stream closefn;
      let gcfn st = closefn () in
      Gc.finalise gcfn stream;
      let body = Body.of_stream stream in
      return (res, body)
如果我读得正确,连接将在GC清理流时立即关闭