1. 编译环境使用VS2008,在调试过程中发现,某个函数的部分代码没有正确执行,在这部分代码处打断点调试,发现每次调试运行时总是提示断点无效。出问题的代码如下,在while(){}代码块内部打断点提示断点无效。
INT32 sendLTEMsg(void *pMsg, INT32 iMsgLen)
{
INT32 t_iLeft = iMsgLen;
INT32 t_iRet = 0;
INT32 t_idx = 0;
if((NULL==pMsg) || (0==iMsgLen))
{
return FALSE;
}
while(t_iLeft>0) /*保证将数据全部发送出去*/
{
t_iRet = send(g_SockClientLTE, &(((char*)pMsg)[t_idx]), t_iLeft, 0);
if(t_iRet == 0)
{
break;
}
else if(t_iRet == SOCKET_ERROR)
{
INT32 t_errcode = WSAGetLastError();
return FALSE;
}
t_iLeft -= t_iRet;
t_idx += t_iRet;
}/*end of while*/
return TRUE;
}
2. 那么,在什么情况下会导致运行时