Click here to Skip to main content
15,888,984 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer011-Feb-12 6:52
SledgeHammer011-Feb-12 6:52 
GeneralRe: basic Winsock / IOCP / UDP question Pin
Jochen Arndt1-Feb-12 7:35
professionalJochen Arndt1-Feb-12 7:35 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer011-Feb-12 7:53
SledgeHammer011-Feb-12 7:53 
GeneralRe: basic Winsock / IOCP / UDP question Pin
Jochen Arndt1-Feb-12 8:00
professionalJochen Arndt1-Feb-12 8:00 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer011-Feb-12 8:09
SledgeHammer011-Feb-12 8:09 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer011-Feb-12 8:19
SledgeHammer011-Feb-12 8:19 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer011-Feb-12 8:31
SledgeHammer011-Feb-12 8:31 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer011-Feb-12 11:10
SledgeHammer011-Feb-12 11:10 
ARGH!! found the problem. I had a fundamental misunderstanding of the logic flow when using I/O completion ports. The TCP side was working, but not in the way I thought it was Smile | :) . The UDP side is also working now.

Basically with I/O completion ports, you ALWAYS get a IO pending on sends & recvs. The GetQueuedCompletionStatus() function operates like a wait. On the TCP side, I created a new CClientContext for each connection which is correct and thus the WSABUF was passed around correctly. On the UDP side, I can't have the shared buffer obviously because it all comes from multiple clients at the same time. So I need to derive a new struct from OVERLAPPED and add the shared members there for UDP and pass that around.

Basically once you get the GetQueuedCompletionStatus() notification, the buffer is already full (assuming you still have access to it -- in my current design, I didn't). Then you call wsarecvfrom AGAIN and it'll start a new overlapped call until new data is available, then GetQueuedCompletionStatus() will return again and so on.

Thanks again for your help.
GeneralRe: basic Winsock / IOCP / UDP question Pin
Jochen Arndt1-Feb-12 21:04
professionalJochen Arndt1-Feb-12 21:04 
QuestionLINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 Pin
KASR130-Jan-12 4:01
KASR130-Jan-12 4:01 
AnswerRe: LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 Pin
Chris Losinger30-Jan-12 4:37
professionalChris Losinger30-Jan-12 4:37 
GeneralRe: LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 Pin
KASR130-Jan-12 5:46
KASR130-Jan-12 5:46 
GeneralRe: LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 Pin
Chris Losinger30-Jan-12 5:51
professionalChris Losinger30-Jan-12 5:51 
GeneralRe: LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 Pin
KASR130-Jan-12 6:42
KASR130-Jan-12 6:42 
QuestionRe: LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 Pin
David Crow30-Jan-12 5:13
David Crow30-Jan-12 5:13 
GeneralRe: LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 Pin
KASR130-Jan-12 5:28
KASR130-Jan-12 5:28 
AnswerRe: LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12 Pin
Stephen Hewitt31-Jan-12 3:22
Stephen Hewitt31-Jan-12 3:22 
QuestionHow to call load a dialog of an activeX control in a mfc application Pin
Adity Bhattacharya30-Jan-12 1:14
Adity Bhattacharya30-Jan-12 1:14 
AnswerRe: How to call load a dialog of an activeX control in a mfc application Pin
«_Superman_»30-Jan-12 16:09
professional«_Superman_»30-Jan-12 16:09 
GeneralRe: How to call load a dialog of an activeX control in a mfc application Pin
Adity Bhattacharya30-Jan-12 17:37
Adity Bhattacharya30-Jan-12 17:37 
GeneralRe: How to call load a dialog of an activeX control in a mfc application Pin
Chandrasekharan P30-Jan-12 17:55
Chandrasekharan P30-Jan-12 17:55 
GeneralRe: How to call load a dialog of an activeX control in a mfc application Pin
Adity Bhattacharya30-Jan-12 21:24
Adity Bhattacharya30-Jan-12 21:24 
GeneralRe: How to call load a dialog of an activeX control in a mfc application Pin
«_Superman_»30-Jan-12 18:06
professional«_Superman_»30-Jan-12 18:06 
GeneralRe: How to call load a dialog of an activeX control in a mfc application Pin
Chandrasekharan P30-Jan-12 18:08
Chandrasekharan P30-Jan-12 18:08 
GeneralRe: How to call load a dialog of an activeX control in a mfc application Pin
Adity Bhattacharya30-Jan-12 21:24
Adity Bhattacharya30-Jan-12 21: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.