TCP/TLS connection pooling for Eio
at main 1.1 kB view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 SPDX-License-Identifier: ISC 4 ---------------------------------------------------------------------------*) 5 6(** Network endpoint representation *) 7 8(** {1 Logging} *) 9 10val src : Logs.Src.t 11(** Logs source for endpoint operations. Configure logging with: 12 {[ 13 Logs.Src.set_level Conpool.Endpoint.src (Some Logs.Debug) 14 ]} *) 15 16(** {1 Type} *) 17 18type t 19(** Network endpoint identified by host and port *) 20 21(** {1 Construction} *) 22 23val make : host:string -> port:int -> t 24(** Create an endpoint from a hostname and port. *) 25 26(** {1 Accessors} *) 27 28val host : t -> string 29(** Get the hostname from an endpoint. *) 30 31val port : t -> int 32(** Get the port number from an endpoint. *) 33 34(** {1 Comparison and Hashing} *) 35 36val equal : t -> t -> bool 37(** Compare two endpoints for equality. *) 38 39val hash : t -> int 40(** Hash an endpoint for use in hash tables. *) 41 42(** {1 Pretty-printing} *) 43 44val pp : t Fmt.t 45(** Pretty-printer for endpoints. Formats as "host:port". *)