Keeps track of a dynamic round-trip timeout that determines how long to wait before resending messages that expect a response More...
Public Member Functions | |
RoundTripTimeout (int initialTimeout=500) | |
void | ReceivedResponse (int roundTripTime) |
Call this when a response is received to update the round trip timeout More... | |
void | ResendingFailedRequest () |
Properties | |
int | Timeout [get] |
Current timeout in milliseconds More... | |
Keeps track of a dynamic round-trip timeout that determines how long to wait before resending messages that expect a response
Conforms to RFC 2988 with the exceptions defined in RFC 5389 Section 7.2.1
Timeout is stored in milliseconds
NobleConnect.RoundTripTimeout.RoundTripTimeout | ( | int | initialTimeout = 500 | ) |
void NobleConnect.RoundTripTimeout.ReceivedResponse | ( | int | roundTripTime | ) |
Call this when a response is received to update the round trip timeout
Note that this should not be called when a response to a re-transmitted message is received as there is no way to know whether it was a response to the original request or the re-transmission, so the roundTripTime can not be reliably calculated.
Not updating the timeout when receiving a response to a re-transmitted message apparently comes from Karn's algorithm which is all the way from 1987. That's almost as old as me. Neat.
I wish I could get an algorithm named after myself for the idea of sometimes not calling a method...such a simpler time.
roundTripTime |
void NobleConnect.RoundTripTimeout.ResendingFailedRequest | ( | ) |
|
get |
Current timeout in milliseconds