CodePudding user response:
Unless you send data over the size of the buffer, you receive part of the code,CodePudding user response:
void __fastcall TServerForm: : ServerSocketClientRead (TObject * Sender,
TCustomWinSocket * Socket)
{
RevNum=Socket - & gt; ReceiveLength ();
If (RevNum!
=3600){ShowMessage (" data reception error!" );
}
The Socket - & gt; ReceiveBuf (Buffer, 3600);
If (startflag==1)
WriteToCB ();//write ring buffer
CurvePlotThread - & gt; Resume ();//drawing thread
}
CodePudding user response:
Receive this part can't see what problem, check the sending part, not receiving the cache issueCodePudding user response:
Send part is generated by the timer timing to sendvoid __fastcall TClientForm: : SendTimerTimer (TObject * Sender)
{
The switch (CurrentLinkStatus)
{
Case Break:
{
ShowMessage (" to connect to the server error, please connect again!" );
SendTimer - & gt; Enabled=false;
break;
}
In case the Link:
{
RandomGenerate ();
SendNum=ClientSocket - & gt; The Socket - & gt; SendBuf (& amp; RandomData, sizeof (RandomData));
If (SendNum!
=3600){SendErNum=WSAGetLastError ();
ShowMessage (" data error! Send bytes for "+ IntToStr (SendNum) +", the error code is "+ IntToStr (SendErNum));
}
break;
}
}
}
CodePudding user response:
I see you are a special function to send data, you with logging data and length, see if there are any problems, to locate the faultCodePudding user response:
Send a set of data, wait for the best, too fast as if there will be a problem