DefaultClientConnectionConfig

class DefaultClientConnectionConfig(val host: String = DEFAULT_HOST, port: Int? = DEFAULT_PORT, protocol: URLProtocol? = null, headers: Map<String, List<String>>? = null, val reconnectionDelay: Duration? = null, val requestTimeout: Duration? = defaultRequestTimeout, val connectTimeout: Duration? = defaultConnectionTimeout) : ClientConnectionConfig(source)

Default implementation of the ClientConnectionConfig class.

This class provides a predefined set of configurations suitable for establishing client-side connections, simplifying the process of initializing connections with default values.

It extends the base functionality of ClientConnectionConfig by offering default settings such as host, port, protocol, and timeouts.

Parameters

host

The hostname or IP address of the server to connect to. Defaults to 127.0.0.1.

port

The port number for the connection. Defaults to 50881.

protocol

The protocol to use for the connection (e.g., HTTP, HTTPS). Defaults to null, using the base class's default protocol instead.

headers

Optional HTTP headers to include in the connection. Defaults to null, which is treated as empty map.

reconnectionDelay

The delay between connection retry attempts, if applicable. Defaults to null.

requestTimeout

The timeout duration for requests. Defaults to 5.seconds.

connectTimeout

The timeout duration for a connection establishment. Defaults to 15.seconds.

Constructors

Link copied to clipboard
constructor(host: String = DEFAULT_HOST, port: Int? = DEFAULT_PORT, protocol: URLProtocol? = null, headers: Map<String, List<String>>? = null, reconnectionDelay: Duration? = null, requestTimeout: Duration? = defaultRequestTimeout, connectTimeout: Duration? = defaultConnectionTimeout)

Types

Link copied to clipboard
object Companion

Companion object for the DefaultClientConnectionConfig class.

Properties

Link copied to clipboard

The timeout duration for establishing a connection, defaulting to null.

Link copied to clipboard

A collection of headers to be applied to HTTP requests made by the client.

Link copied to clipboard

A computed property that constructs the URL endpoint for health check requests.

Link copied to clipboard

The hostname or IP address of the target server to connect to.

Link copied to clipboard

Provides access to the current JSON serialization and deserialization configuration.

Link copied to clipboard

Constructs the URL endpoint for sending or receiving messages.

Link copied to clipboard
val port: Int

The port number used for establishing a client connection.

Link copied to clipboard

The protocol used for the client connection.

Link copied to clipboard

The delay between attempts to reconnect, if applicable, defaulting to null.

Link copied to clipboard

The timeout duration for requests, defaulting to null.

Link copied to clipboard

Constructs the URL endpoint for Server-Sent Events (SSE) communication.

Link copied to clipboard
val url: String

Provides the base URL for the current connection configuration. Constructs the URL using the protocol, host, and port specified in the connection configuration.

Functions

Link copied to clipboard

Appends the specified serializers module to the existing JSON configuration. This method allows dynamic addition of custom serialization and deserialization logic by merging the provided module with the current serializers module.