receiveTimeout property

Duration? get receiveTimeout

Timeout when receiving data.

The timeout represents:

  • a timeout before the connection is established and the first received response bytes.
  • the duration during data transfer of each byte event, rather than the total duration of the receiving.

Throws the DioException with DioExceptionType.receiveTimeout type when timed out.

null or Duration.zero means no timeout limit.

Implementation

Duration? get receiveTimeout => _receiveTimeout;
set receiveTimeout (Duration? value)

Implementation

set receiveTimeout(Duration? value) {
  if (value != null && value.isNegative) {
    throw ArgumentError.value(value, 'receiveTimeout', 'should be positive');
  }
  _receiveTimeout = value;
}