O
oldwolf201
Unregistered / Unconfirmed
GUEST, unregistred user!
void __fastcall TMyThread::Execute()
{
while(blncontinue)
{
memset(RecvBuf, 0, sizeof(RecvBuf));
//表示接收内网的IP包
blnin=false;
//接收内部IP包
iErrorCode = recv(Sockin, RecvBuf, sizeof(RecvBuf), 0);
if (iErrorCode>=0)
{
CheckSockError(iErrorCode,"recv");
//IP包解包
blncontinue = DecodeIpPack(RecvBuf, iErrorCode);
if (blncontinue)
{
CheckSockError(iErrorCode, "Decode");
//IP_HEADER *pIpheader;
//pIpheader = (IP_HEADER *)RecvBuf;
//ShowMessage(pIpheader->sourceIP);
//ShowMessage(pIpheader->destIP);
iErrorCode=send(Sockout,RecvBuf,sizeof(RecvBuf),3);
}
else
blncontinue=true;
}
}
}
iErrorCode的值始终为-1,请问原因何在?
{
while(blncontinue)
{
memset(RecvBuf, 0, sizeof(RecvBuf));
//表示接收内网的IP包
blnin=false;
//接收内部IP包
iErrorCode = recv(Sockin, RecvBuf, sizeof(RecvBuf), 0);
if (iErrorCode>=0)
{
CheckSockError(iErrorCode,"recv");
//IP包解包
blncontinue = DecodeIpPack(RecvBuf, iErrorCode);
if (blncontinue)
{
CheckSockError(iErrorCode, "Decode");
//IP_HEADER *pIpheader;
//pIpheader = (IP_HEADER *)RecvBuf;
//ShowMessage(pIpheader->sourceIP);
//ShowMessage(pIpheader->destIP);
iErrorCode=send(Sockout,RecvBuf,sizeof(RecvBuf),3);
}
else
blncontinue=true;
}
}
}
iErrorCode的值始终为-1,请问原因何在?