java.lang.Object
net.i2p.router.transport.TransportBid
Represents a transport's bid for message delivery cost. Provide a bid for how much it would "cost" to transfer a message of a particular peer.
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSentinel cost a transport bids when it cannot deliver the message right now.Constructor Summary
ConstructorsConstructorDescriptionCreates a bid with no latency cost yet, marked by a negative bid value.Method Summary
All MethodsModifier and TypeMethodDescriptionintHow long this transport thinks it would take to send the message This is the actual bid value, lower is better, and it doesn't really have anything to do with latency.Specifies the transport that offered this bid.voidsetLatencyMs(int milliseconds) The latency bid value in milliseconds.voidsetTransport(Transport transport) The transport that offered this bid.
Field Details
TRANSIENT_FAIL
public static final int TRANSIENT_FAILSentinel cost a transport bids when it cannot deliver the message right now.- See Also:
Constructor Details
TransportBid
public TransportBid()Creates a bid with no latency cost yet, marked by a negative bid value.
Method Details
getLatencyMs
public int getLatencyMs()How long this transport thinks it would take to send the message This is the actual bid value, lower is better, and it doesn't really have anything to do with latency.- Returns:
- the latency ms
setLatencyMs
public void setLatencyMs(int milliseconds) The latency bid value in milliseconds.- Parameters:
milliseconds- the delivery cost this transport is bidding, in milliseconds; lower is better, and negative means no bid was made
getTransport
Specifies the transport that offered this bid.- Returns:
- the transport making the bid, or null if not yet recorded
setTransport
The transport that offered this bid.- Parameters:
transport- the transport making the bid, recorded so the cost can be attributed when the message is assigned