Package com.tuladb
Record Class LedgerClient.Timeouts
java.lang.Object
java.lang.Record
com.tuladb.LedgerClient.Timeouts
- Enclosing class:
LedgerClient
Socket timeouts, in milliseconds. Matches the C SDK's
connect_timeout_ms / read_timeout_ms / write_timeout_ms.
connectMsbounds the TCP connect. 0 (or less) means the default, 30 000 ms, as in the C SDK: a dial is never unbounded.readMsbounds each wait for reply bytes (the socket'sSO_TIMEOUT): a reply that keeps arriving is not cut off. 0 = no limit.writeMsbounds each wait for the peer to drain what we send, per 16 KiB chunk. 0 = no limit.
The TLS handshake is bounded in total, from its start, by the larger of
readMs and writeMs (each of its reads also by
readMs); with both 0 it is unbounded.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTimeouts(int connectMs, int readMs, int writeMs) Creates an instance of aTimeoutsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theconnectMsrecord component.static LedgerClient.Timeoutsdefaults()30 s connect, read and write: the C SDK's defaults.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static LedgerClient.Timeoutsof(int ms) The same value for all three: what the legacyint timeoutMsconstructors use, so they now bound writes as well as reads.intreadMs()Returns the value of thereadMsrecord component.final StringtoString()Returns a string representation of this record class.intwriteMs()Returns the value of thewriteMsrecord component.
-
Field Details
-
DEFAULT_MS
public static final int DEFAULT_MS- See Also:
-
-
Constructor Details
-
Timeouts
public Timeouts(int connectMs, int readMs, int writeMs) Creates an instance of aTimeoutsrecord class.- Parameters:
connectMs- the value for theconnectMsrecord componentreadMs- the value for thereadMsrecord componentwriteMs- the value for thewriteMsrecord component
-
-
Method Details
-
defaults
30 s connect, read and write: the C SDK's defaults. -
of
The same value for all three: what the legacyint timeoutMsconstructors use, so they now bound writes as well as reads. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
connectMs
public int connectMs()Returns the value of theconnectMsrecord component.- Returns:
- the value of the
connectMsrecord component
-
readMs
public int readMs()Returns the value of thereadMsrecord component.- Returns:
- the value of the
readMsrecord component
-
writeMs
public int writeMs()Returns the value of thewriteMsrecord component.- Returns:
- the value of the
writeMsrecord component
-