It has good compatibility, as if MaxRtt is not set, it will have the same behavior as before.
However, there are still some issues remaining.
The timing is not precise; for example, if a maximum round-trip time (maxrtt) of 100ms is set, but the request time exceeds 101ms, it is possible that the OnRecv function will still be used.
If a request is received after the timeout, the OnDuplicateRecv function will be called.
I believe that developers should have a way to know when a data packet is lost or does not return within a specified time.
you can set MaxRtt and OnTimeout func
Ontime func while be call when a request was not answered within a specified time
you only need add:
It has good compatibility, as if MaxRtt is not set, it will have the same behavior as before.
However, there are still some issues remaining.
But I believe that this is acceptable.