call

inline suspend fun <R> call(method: String, timeout: Long = config.requestTimeout): R

Sends a request to the server and awaits a response.

Suspends if the client is connecting or reconnecting; it waits for a valid connection.

Throws

TimeoutCancellationException

if no response is received within timeout.


inline suspend fun <P, R> call(method: String, params: P, timeout: Long = config.requestTimeout): R

Sends a request with parameters using automatic serialization.

Suspends if the client is connecting or reconnecting; it waits for a valid connection.

Throws

TimeoutCancellationException

if no response is received within timeout.


suspend fun <R> call(method: String, responseSerializer: KSerializer<R>, timeout: Long = config.requestTimeout): R
inline suspend fun <P, R> call(method: String, params: P, paramSerializer: KSerializer<P>, responseSerializer: KSerializer<R>, timeout: Long = config.requestTimeout): R

Sends a request with parameters using a manual serializer.

Useful for types where standard reified type inference might fail (e.g., generic collections).

Suspends if the client is connecting or reconnecting; it waits for a valid connection.

Throws

TimeoutCancellationException

if no response is received within timeout.