Skip to content

ClientConnectionConfig

[Source]

Configuration for an HTTP client connection.

Parser limits control the maximum size of response components. Idle timeout controls how long the connection can sit without I/O activity before the library closes it. Connection timeout bounds how long the initial connection handshake is allowed to take. from specifies the local bind address (empty string means any interface).

// All defaults (60-second idle timeout, 10 MB max body)
ClientConnectionConfig

// Custom idle timeout via MakeIdleTimeout (milliseconds)
let timeout = match lori.MakeIdleTimeout(30_000)
| let t: lori.IdleTimeout => t
end
ClientConnectionConfig(where
  max_body_size' = 52_428_800,  // 50 MB
  idle_timeout' = timeout)

// Disable idle timeout
ClientConnectionConfig(where idle_timeout' = None)

// Set a 5-second connection timeout
let ct = match lori.MakeConnectionTimeout(5_000)
| let t: lori.ConnectionTimeout => t
end
ClientConnectionConfig(where connection_timeout' = ct)
class val ClientConnectionConfig

Constructors

create

[Source]

Create client connection configuration.

Parser limits default to sensible values. idle_timeout' is an IdleTimeout (milliseconds) or None to disable idle timeout. Defaults to 60 seconds. connection_timeout' is a ConnectionTimeout (milliseconds) or None to disable connection timeout. Defaults to None. from' specifies the local bind address (empty string means any interface).

new val create(
  max_status_line_size': USize val = 8192,
  max_header_size': USize val = 8192,
  max_chunk_header_size': USize val = 128,
  max_body_size': USize val = 10485760,
  idle_timeout': (Constrained[U64 val, IdleTimeoutValidator val] val | None val) = call,
  connection_timeout': (Constrained[U64 val, ConnectionTimeoutValidator val] val | None val) = reference,
  from': String val = "")
: ClientConnectionConfig val^

Parameters

Returns


Public fields

let max_status_line_size: USize val

[Source]


let max_header_size: USize val

[Source]


let max_chunk_header_size: USize val

[Source]


let max_body_size: USize val

[Source]


let idle_timeout: (Constrained[U64 val, IdleTimeoutValidator val] val | None val)

[Source]


let connection_timeout: (Constrained[U64 val, ConnectionTimeoutValidator val] val | None val)

[Source]


let from: String val

[Source]