Commit 8ea46224 by 刘帅

fix:TCP套接字单次发送长度

parent a7de2ce8
......@@ -866,10 +866,15 @@ int QFmClient::sendAESData2Proxy(int sock, char *buf, int length)
toSendLength = toSendLength + header_size;
int curSendLength = 0;
int rlt = 0;
int fixLength = 512; /*send length should less than 536.
otherwise will be occur [TCP Retransmission] error on XP platform at sometime.*/
while(curSendLength < toSendLength)
{
int res = send(sock, out + curSendLength, toSendLength - curSendLength, 0);
if(toSendLength - curSendLength < 512)
{
fixLength = toSendLength - curSendLength;
}
int res = send(sock, out + curSendLength, fixLength/*toSendLength - curSendLength*/, 0);
if(res == SOCKET_ERROR)
{
int err = WSAGetLastError();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment