Click here to Skip to main content
15,881,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: trying to solve exam question and getting unreasonable length code, can it be shorter? [modified] Pin
Alain Rist3-Jul-11 23:54
Alain Rist3-Jul-11 23:54 
GeneralRe: trying to solve exam question and getting unreasonable length code, can it be shorter? Pin
Stefan_Lang4-Jul-11 0:37
Stefan_Lang4-Jul-11 0:37 
GeneralRe: trying to solve exam question and getting unreasonable length code, can it be shorter? Pin
Alain Rist4-Jul-11 5:01
Alain Rist4-Jul-11 5:01 
QuestionC++ DLL for Metatrader 4 Platform Pin
babelproofreader1-Jul-11 8:24
babelproofreader1-Jul-11 8:24 
AnswerRe: C++ DLL for Metatrader 4 Platform Pin
Philippe Mori1-Jul-11 9:07
Philippe Mori1-Jul-11 9:07 
QuestionIOCP, Completion Key and Overlapped Pin
csrss1-Jul-11 7:39
csrss1-Jul-11 7:39 
AnswerRe: IOCP, Completion Key and Overlapped Pin
Mark Salsbery1-Jul-11 9:33
Mark Salsbery1-Jul-11 9:33 
GeneralRe: IOCP, Completion Key and Overlapped Pin
csrss1-Jul-11 10:48
csrss1-Jul-11 10:48 
Mark Salsbery wrote:
The key is per-handle, not per device.

Thanks! This explains couple of things.
Ok, so (from that what i can see) if this will be a good practice (currently i am reusing custom Overlapped struct too):

1. Key data structure, which holds, lets say, a socket - accepted or connected or listening, some other things related to a socket, which are valid as long as our socket is valid, for example local and remote ip addr and port. - so all this lives as long as our socket lives

2. Extended Overlapped structure, which holds, for example, such info like current I/O operation and WSABUF and probably nothing else.

Or maybe all this is just playing around and doesn't matter at all and it's ok to just use extended Overlapped all the time? And, (probably) last (probably lame :P) question - it just came to my mind, for now my server prototype is running on localhost and not event close to be loaded so every call to wsasend / wsarecv completes right away without waiting and i am manually posting completion packets with PostQueuedCompletionStatus to simulate expected behavior, where key param is my struct of course, and IO operation is updated before packet is actually posted. So on the other end, i am parsing IO operations correctly. But, i am thinking now, if wsarecv will block and completion packet will arrive some time later - so how on the other end i can correctly parse current IO operation? And maybe exactly in such case - i need this extended overlapped and only, because on the other end (in worker thread in fact) - when packet will arrive, - i'll get this exact Overlapped and will be able to grab current IO?

Am i crazy, wrong or maybe this is how it is? Big Grin | :-D
Thanks in advance
011011010110000101100011011010000110100101101110
0110010101110011

GeneralRe: IOCP, Completion Key and Overlapped Pin
cmk1-Jul-11 11:37
cmk1-Jul-11 11:37 
GeneralRe: IOCP, Completion Key and Overlapped Pin
Mark Salsbery1-Jul-11 13:08
Mark Salsbery1-Jul-11 13:08 
GeneralRe: IOCP, Completion Key and Overlapped Pin
csrss1-Jul-11 19:51
csrss1-Jul-11 19:51 
GeneralRe: IOCP, Completion Key and Overlapped Pin
Mark Salsbery2-Jul-11 6:03
Mark Salsbery2-Jul-11 6:03 
AnswerRe: IOCP, Completion Key and Overlapped Pin
cmk1-Jul-11 10:46
cmk1-Jul-11 10:46 
GeneralRe: IOCP, Completion Key and Overlapped Pin
csrss1-Jul-11 11:13
csrss1-Jul-11 11:13 
QuestionEncryption/Decyption of String. Pin
Le@rner1-Jul-11 2:57
Le@rner1-Jul-11 2:57 
AnswerRe: Encryption/Decyption of String. Pin
Code-o-mat1-Jul-11 3:34
Code-o-mat1-Jul-11 3:34 
AnswerRe: Encryption/Decyption of String. Pin
cmk1-Jul-11 10:56
cmk1-Jul-11 10:56 
QuestionMaking an "SDI" MFC DLL Pin
Srikant Iyer1-Jul-11 1:46
Srikant Iyer1-Jul-11 1:46 
QuestionC++ Pin
Karthik931730-Jun-11 20:36
Karthik931730-Jun-11 20:36 
AnswerRe: C++ Pin
Richard MacCutchan30-Jun-11 22:35
mveRichard MacCutchan30-Jun-11 22:35 
AnswerRe: C++ Pin
Albert Holguin1-Jul-11 4:23
professionalAlbert Holguin1-Jul-11 4:23 
Questionfopen gives segmentation fault. Pin
krosty478230-Jun-11 18:44
krosty478230-Jun-11 18:44 
AnswerRe: fopen gives segmentation fault. Pin
enhzflep30-Jun-11 19:30
enhzflep30-Jun-11 19:30 
AnswerRe: fopen gives segmentation fault. Pin
Chuck O'Toole30-Jun-11 20:24
Chuck O'Toole30-Jun-11 20:24 
QuestionGetting Static control styles [MFC] Pin
csrss30-Jun-11 9:58
csrss30-Jun-11 9:58 

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.