CMPPCONNECT示例代码

CMPPCONNECT示例代码
无效csmscmpp::encodeconnect(const长nsecid ssrcaddr,字符串常量,字符串常量说明)
{
m_smheader.lcommandlength = 39;
m_smheader.lcommandid = cmpp_connect;
m_smheader.lsequencenumber = nsecid;
EncodeHeader();

字符串sauthname;
如果(int(suser.size())> 0){
sauthname = suser.c_str();
}
{其他
sauthname = ssrcaddr.c_str();
}
appendoct(m_body,(PBYTE)sauthname.c_str(),6);

矢量vauth;
std::复制(sauthname.begin(),(),sauthname.end back_inserter(vauth));
为(int i = 0;我std::复制(spwd.begin(),(),spwd.end back_inserter(vauth));
字符串sstamp = getcurtime();
std::复制(sstamp.begin(),(),sstamp.end back_inserter(vauth));

char 400 { };
memset(SRC,0400);
std::复制(vauth.begin(),(),vauth.end SRC);

PBYTE温度=新的字节{ 17 };
memset(临时0,17);
DWORD dwSize;
cryptmd5hash((PBYTE)SRC,int(vauth.size()),温度,dwSize);

ostringstream之上OSS;
OSS

appendoct(m_body,(PBYTE)温度,16); / / ICP认证码
删除{临时};

appendint(m_body,女儿红);
DWORD ltimestamp = atoi(sstamp.c_str());
ltimestamp = htonl(ltimestamp);
appendoct(m_body,ltimestamp(PBYTE),4);
}

tag:示例代码电脑软件CMPPCONNECT

相关内容