Click here to Skip to main content
15,900,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer0131-Jan-12 5:01
SledgeHammer0131-Jan-12 5:01 
GeneralRe: basic Winsock / IOCP / UDP question Pin
Jochen Arndt31-Jan-12 5:51
professionalJochen Arndt31-Jan-12 5:51 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer0131-Jan-12 6:27
SledgeHammer0131-Jan-12 6:27 
GeneralRe: basic Winsock / IOCP / UDP question Pin
Jochen Arndt31-Jan-12 6:43
professionalJochen Arndt31-Jan-12 6:43 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer0131-Jan-12 6:58
SledgeHammer0131-Jan-12 6:58 
GeneralRe: basic Winsock / IOCP / UDP question Pin
Jochen Arndt31-Jan-12 7:14
professionalJochen Arndt31-Jan-12 7:14 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer0131-Jan-12 7:19
SledgeHammer0131-Jan-12 7:19 
GeneralRe: basic Winsock / IOCP / UDP question Pin
SledgeHammer0131-Jan-12 14:12
SledgeHammer0131-Jan-12 14:12 
Hmm... seems like its not working after all Frown | :( This is what I do:

1) WSAStartup() and m_hIOCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
2) getaddrinfo() to get the IPv4 & IPv6 interfaces
3) for each on items returned from getaddrinfo() WSASocket(...WSA_FLAG_OVERLAPPED) and bind()) and CreateIoCompletionPort((HANDLE)socket, m_hIOCompletionPort, (DWORD)pClientContext, 0); foreach worker thread (I have 8), I post a WSARecvFrom()

step #3 is executed twice... once for the ipv4 socket and once for the ipv6 socket

ISSUE #1: the WSARecvFrom always returns -1 and WSAGetLastError is 997 (IO pending), I don't think thats quite right??

ISSUE #2: in my workerthread, I do:

BOOL bReturn = GetQueuedCompletionStatus(m_hIOCompletionPort, &dwBytesTransferred,
(LPDWORD)&pClientContext, &pOverlapped, INFINITE);

I get past this blocking call and dwBytesTransferred = 3 which is correct since my client just sent "0\r\n".

so I call WSARecvFrom() and again, I get -1 and IO pending? Confused | :confused: Confused | :confused: Confused | :confused:
GeneralRe: basic Winsock / IOCP / UDP question Pin
Jochen Arndt31-Jan-12 21:25
professionalJochen Arndt31-Jan-12 21:25 
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 
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 

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.