📄 iannetmr.c
字号:
/***********************************************************************
Copyright (c) 2002 RADVISION Ltd.
************************************************************************
NOTICE:
This document contains information that is confidential and proprietary
to RADVISION Ltd.. No part of this document may be reproduced in any
form whatsoever without written prior approval by RADVISION Ltd..
RADVISION Ltd. reserve the right to revise this publication and make
changes without obligation to notify any person of such revisions or
changes.
***********************************************************************/
#include "rvinternal.h"
#include "annexe.h"
#include "iannexe.h"
#ifdef __cplusplus
extern "C" {
#endif
RvUint32 get_delay_interval( tNode* pNode ) {
return pNode->pAnnexE->t_DT;
}
RvUint32 get_retransmit_interval( tNode* pNode ) {
tAnnexE* pAnnexE = pNode->pAnnexE;
return pAnnexE->t_R1 + (pAnnexE->t_R2 - pAnnexE->t_R1) * pNode->nRetry;
}
RvUint32 get_ima_interval( tNode* pNode ) {
return pNode->pAnnexE->t_IMA1;
}
RvBool start_retransmit_or_ima_timer( IN tNode* pNode )
{
RvUint32 timeout;
RvH323TimerCancel(pNode->pAnnexE->hTimers, &pNode->hResendAndIMATimer);
if (pNode->pWaitingForAckPDU != NULL)
timeout = get_retransmit_interval(pNode);
else
timeout = get_ima_interval(pNode);
pNode->hResendAndIMATimer = RvH323TimerStart(pNode->pAnnexE->hTimers, retransmit_or_ima_timer_event, pNode, timeout);
return RV_FALSE;
}
void stop_retransmit_or_ima_timer( tNode* pNode ) {
RvH323TimerCancel(pNode->pAnnexE->hTimers, &pNode->hResendAndIMATimer);
}
void RVCALLCONV delay_timer_event(void* context) {
tNode* pNode = (tNode*)context;
if (pNode->pCurrentPDU == NULL)
{
RvLogExcep(&pNode->pAnnexE->log, (&pNode->pAnnexE->log,
"delay_timer_event: No current PDU..."));
return;
}
send_current_pdu( pNode );
}
RvBool retransmit_or_ima_timer_event(IN void* context)
{
tNode* pNode = (tNode*)context;
RvH323TimerClear(pNode->pAnnexE->hTimers, &pNode->hResendAndIMATimer);
if (pNode->pWaitingForAckPDU != NULL)
{
/* retransmit timer event! */
if (pNode->nRetry++ == pNode->pAnnexE->n_R1)
{
remote_host_is_dead( pNode );
return RV_FALSE;
}
RvLogInfo(&pNode->pAnnexE->log,
(&pNode->pAnnexE->log, "Retransmit PDU to Host(%08x:%i), retry=%i",
pNode->RemoteHost.nIP, pNode->RemoteHost.nPort, pNode->nRetry-1));
send_pdu( pNode->pAnnexE, pNode->pWaitingForAckPDU );
}
else {
/* ima timer event! */
if (pNode->nRetry++ == pNode->pAnnexE->n_IMA1)
{
remote_host_is_dead( pNode );
return RV_FALSE;
}
RvLogInfo(&pNode->pAnnexE->log,
(&pNode->pAnnexE->log, "IAmAlive timer event - Send IMA to Host(%08x:%i), retry=%i",
pNode->RemoteHost.nIP, pNode->RemoteHost.nPort, pNode->nRetry-1));
/* send ima payload*/
send_ima(pNode, RV_TRUE);
}
return start_retransmit_or_ima_timer(pNode);
}
#ifdef __cplusplus
}
#endif /* __cplusplus*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -