|
UINT dataLength;
m_cSocket.Receive (&dataLength, 4);
CFile destFile ("e:\\11.xls", CFile :: modeCreate | CFile :: modeWrite | CFile :: typeBinary);
byte * data = new byte [dataLength];
m_cSocket.Receive (data, dataLength); destFile.Write (data, dataLength);
delete data;
destFile.Close ();
m_cSocket.Close ();
This paragraph is used to accept files and write files, but in the process of breakpoint debugging, m_cSocket.Receive (data, dataLength); You can see that the data of this sentence is correct, the file written is correct, but one The official operation is incorrect. It seems that the correct data is not received. The written documents are garbled. What is going on? |
|