⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dnputpack.cpp

📁 SMS gateway. SMS protocol for CHINA mobile, unicom, lingtong. Using mysql to exchange message.
💻 CPP
字号:
/**********************************************************************
  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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -