我正在写类似下面的东西(直径协议),我需要实现一个计时器来监视会话挂起状态并在它们超过某个阈值时终止它们,最好的方法是什么?
请注意,我正在寻找算法。
Credit-Control Application Related Parameters
Tx timer
When real-time credit-control is required, the credit-control
client contacts the credit-control server before and while the
service is provided to an end user. Due to the real-time nature
of the application, the communication delays SHOULD be minimized;
e.g., to avoid an overly long service setup time experienced by
the end user. The Tx timer is introduced to control the waiting
time in the client in the Pending state. When the Tx timer
elapses, the credit-control client takes an action to the end user
according to the value of the Credit-Control-Failure-Handling AVP
or Direct-Debiting-Failure-Handling AVP. The recommended value is
10 seconds.