dnputpack.cpp

来自「SMS gateway. SMS protocol for CHINA mobi」· C++ 代码 · 共 58 行

CPP
58
字号
/**********************************************************************
  FileName            : DnPutPack.cpp
  Description         : 放协议包进下端发送队列的函数集
  Version             : 1.0
  Date                : 2003年9月20日
  Author              : 刘荣辉
  Other               : 
***********************************************************************/

#include "DnNode.h"

//int PutActiveTest();//往发送队列中放ActiveTest包
//往发送队列中放Submit包,Origin_Seq为被转发的源请求包流水号,若非转发包则为0
//int PutSubmit(void * pSubmit, int Origin_Seq);

//=====================================================================================
//==============================往发送队列中放ActiveTest包=============================
//=====================================================================================
int CDnNode::PutActiveTest()
{
  SendQUnit  SUnit;
  char sSysEvent[SYS_EVENT_LEN];
  CMPP_Active_Test *ActTest;
  int Sequence;
  
  ActTest = (CMPP_Active_Test *)malloc(sizeof(CMPP_Active_Test));
  ActTest->Total_Length = htonl(sizeof(CMPP_Active_Test));
  ActTest->Command_Id = htonl(CMPP_ACTIVE_TEST);
  Sequence = GetSequence();
  ActTest->Sequence_Id = htonl(Sequence);

  SUnit.Pack = (char *)ActTest;
  time_t nowtime;
  time(&nowtime);
  SUnit.SendTime = nowtime;
  SUnit.iResent = 1;
  //SUnit.SrcSequence = 0;	//转发包流水号
  if(SendQ->Put(SUnit)==false)
  {
	  sprintf(sSysEvent,"Warning: SendQ of DnNode[%s] is full!",ServiceCode);
	  WrSystemLog->WriteLog(sSysEvent,SYSTEMLOG);
	  return 0;
  }

  #ifdef DEBUG
  //printf("\n PutActiveTest: An CMPP_ActiveTest[%d] is put into SendQ of DnNode[%s]! \n",Sequence,ServiceCode);
  #endif
  return Sequence;
}
//=====================================================================================
//===============================往发送队列中放Deliver包================================
//=====================================================================================
//往发送队列中放Deliver包,Origin_Seq为被转发的源请求包流水号,若非转发包则为0
int CDnNode::PutDeliver(void * pSubmit, char *SrcNode, int Origin_Seq)
{
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?