ConnectionParameters constructor
Creates connection parameters for the cache manager.
connectionTimeout limits how long to wait for the server to respond
with headers (i.e. the TCP connection + TLS handshake + first response).
A TimeoutException is thrown if the server does not respond in time.
requestTimeout limits how long to wait between consecutive data chunks
while streaming the response body. This is an inactivity timeout — it
does not cap the total download duration. A slow-but-progressing
download will never be interrupted. A TimeoutException is thrown if no
data arrives within the specified duration.
Implementation
ConnectionParameters({
this.connectionTimeout,
this.requestTimeout,
}) {
if (connectionTimeout != null && connectionTimeout!.isNegative) {
throw ArgumentError.value(
connectionTimeout,
'connectionTimeout',
'Must be greater than or equal to zero.',
);
}
if (requestTimeout != null && requestTimeout!.isNegative) {
throw ArgumentError.value(
requestTimeout,
'requestTimeout',
'Must be greater than or equal to zero.',
);
}
}