bool DataSend(unsigned char* sendbuf,int lenth,SOCKET& sd,bool recon)
{
bool linked=true;
int rt_code = 0;
if(linked==true)
{
rt_code = write(sd,(char*)sendbuf,lenth);
if (rt_code == SOCKET_ERROR)
{
rt_code = WSAGetLastError();
if (rt_code == WSAEWOULDBLOCK)
return true;
else
{
closesocket(sd);
sd = INVALID_SOCKET;
return false;
}
}
else
return true;
}
return false;
}
{
bool linked=true;
int rt_code = 0;
if(linked==true)
{
rt_code = write(sd,(char*)sendbuf,lenth);
if (rt_code == SOCKET_ERROR)
{
rt_code = WSAGetLastError();
if (rt_code == WSAEWOULDBLOCK)
return true;
else
{
closesocket(sd);
sd = INVALID_SOCKET;
return false;
}
}
else
return true;
}
return false;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货