Click here to Skip to main content
15,896,606 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to send huge data via sockets in continuous intervals Pin
Richard MacCutchan22-May-16 20:58
mveRichard MacCutchan22-May-16 20:58 
GeneralRe: How to send huge data via sockets in continuous intervals Pin
manoharbalu23-May-16 3:08
manoharbalu23-May-16 3:08 
GeneralRe: How to send huge data via sockets in continuous intervals Pin
Richard MacCutchan23-May-16 3:33
mveRichard MacCutchan23-May-16 3:33 
AnswerRe: How to send huge data via sockets in continuous intervals Pin
leon de boer22-May-16 22:16
leon de boer22-May-16 22:16 
GeneralRe: How to send huge data via sockets in continuous intervals Pin
manoharbalu23-May-16 3:07
manoharbalu23-May-16 3:07 
GeneralRe: How to send huge data via sockets in continuous intervals Pin
leon de boer23-May-16 5:41
leon de boer23-May-16 5:41 
GeneralRe: How to send huge data via sockets in continuous intervals Pin
manoharbalu24-May-16 1:57
manoharbalu24-May-16 1:57 
GeneralRe: How to send huge data via sockets in continuous intervals Pin
leon de boer24-May-16 4:01
leon de boer24-May-16 4:01 
I am still concerned you are bleeding memory did you check the program memory usage isn't continually growing?

Can you use m_sData.Empty(); rather that m_sData = _T(""); I rarely use MFC strings but that line is ringing alarm bells with me.

To smooth the recption down you really need to build a parser on the receive data rather than just sit looping around waiting for the full packet.

Can I get a look at the code for ReceiveData .. as in the call ... ReceiveData(&TransData);

Finally can I suggest you format the data into 3 sections, which was actually suggested to you back in April to make parsing easier and robust.
The packet transmission will be a (i) A fixed signature (ii) a data body size (iii) the body data of the size of (ii)

The parser would be 4 stage .... read signature, read data size, read data, data available (do what you want with it).

enum ReadParseStatus {
readSigState = 0,
readDataSizeState,
readDataBodyState,
readDataAvailState
};

The fix signature needs to be something unlikely to be in data along lines of
const char signature[] = "PACKETSIG%$#";

Your server needs to output matching data packets. Same signature, the size of the data body and then the data body.

If you provide the ReceiveData code I can help with the parser setup, which is a lot better than looping around waiting for data and it's pretty trivial.
In vino veritas


modified 24-May-16 10:49am.

GeneralRe: How to send huge data via sockets in continuous intervals Pin
manoharbalu24-May-16 20:44
manoharbalu24-May-16 20:44 
GeneralRe: How to send huge data via sockets in continuous intervals Pin
leon de boer25-May-16 22:08
leon de boer25-May-16 22:08 
SuggestionRe: How to send huge data via sockets in continuous intervals Pin
David Crow23-May-16 3:41
David Crow23-May-16 3:41 
AnswerRe: How to send huge data via sockets in continuous intervals Pin
Joe Woodbury25-May-16 6:42
professionalJoe Woodbury25-May-16 6:42 
QuestionInput multiple data types from a file into a linked list Pin
Farhan_Karim20-May-16 17:51
Farhan_Karim20-May-16 17:51 
AnswerRe: Input multiple data types from a file into a linked list Pin
Richard MacCutchan20-May-16 21:54
mveRichard MacCutchan20-May-16 21:54 
GeneralRe: Input multiple data types from a file into a linked list Pin
Farhan_Karim20-May-16 22:08
Farhan_Karim20-May-16 22:08 
GeneralRe: Input multiple data types from a file into a linked list Pin
Richard MacCutchan20-May-16 22:30
mveRichard MacCutchan20-May-16 22:30 
GeneralRe: Input multiple data types from a file into a linked list Pin
leon de boer22-May-16 4:00
leon de boer22-May-16 4:00 
QuestionRe: Input multiple data types from a file into a linked list Pin
David Crow21-May-16 14:45
David Crow21-May-16 14:45 
QuestionIs it good practice for a beginner C++ coder to use autocomplete? Pin
Member KL20-May-16 10:16
Member KL20-May-16 10:16 
SuggestionRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
David Crow20-May-16 10:26
David Crow20-May-16 10:26 
GeneralRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Albert Holguin20-May-16 13:10
professionalAlbert Holguin20-May-16 13:10 
GeneralRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Richard MacCutchan20-May-16 21:40
mveRichard MacCutchan20-May-16 21:40 
GeneralRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Albert Holguin22-May-16 8:40
professionalAlbert Holguin22-May-16 8:40 
AnswerRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Albert Holguin20-May-16 13:13
professionalAlbert Holguin20-May-16 13:13 
AnswerRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Patrice T20-May-16 19:24
mvePatrice T20-May-16 19:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.