Click here to Skip to main content
15,913,669 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: firmware coding in C Pin
Richard MacCutchan30-Jan-12 23:37
mveRichard MacCutchan30-Jan-12 23:37 
AnswerRe: firmware coding in C Pin
CPallini31-Jan-12 2:25
mveCPallini31-Jan-12 2:25 
AnswerRe: firmware coding in C Pin
Bram van Kampen31-Jan-12 12:27
Bram van Kampen31-Jan-12 12:27 
AnswerRe: firmware coding in C Pin
Erudite_Eric31-Jan-12 21:05
Erudite_Eric31-Jan-12 21:05 
Question::ifstream.open behaves differently in VC6 and VS2010 Pin
KASR130-Jan-12 22:31
KASR130-Jan-12 22:31 
AnswerRe: ::ifstream.open behaves differently in VC6 and VS2010 Pin
CPallini30-Jan-12 22:42
mveCPallini30-Jan-12 22:42 
GeneralRe: ::ifstream.open behaves differently in VC6 and VS2010 Pin
KASR131-Jan-12 3:24
KASR131-Jan-12 3:24 
AnswerRe: ::ifstream.open behaves differently in VC6 and VS2010 Pin
Albert Holguin31-Jan-12 3:37
professionalAlbert Holguin31-Jan-12 3:37 
GeneralRe: ::ifstream.open behaves differently in VC6 and VS2010 Pin
KASR131-Jan-12 3:42
KASR131-Jan-12 3:42 
AnswerRe: ::ifstream.open behaves differently in VC6 and VS2010 Pin
Albert Holguin31-Jan-12 5:17
professionalAlbert Holguin31-Jan-12 5:17 
GeneralRe: ::ifstream.open behaves differently in VC6 and VS2010 Pin
KASR11-Feb-12 7:29
KASR11-Feb-12 7:29 
Questionbasic Winsock / IOCP / UDP question Pin
SledgeHammer0130-Jan-12 13:01
SledgeHammer0130-Jan-12 13:01 
AnswerRe: basic Winsock / IOCP / UDP question Pin
Jochen Arndt30-Jan-12 22:19
professionalJochen Arndt30-Jan-12 22:19 
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 

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.