Win32 ASYNC problem
Hi, I recently read the Async tutorial for windows 32 sockets. So i decided to make a simple server/client type program, but for some reason, everytime I recv something..it seems I recieve it twice..(like the FD_READ is ran twice in a ro) .here is my FD_READ message handler
case FD_READ:
MainDSock.Recv((char*)&packet, sizeof(struct Packet));
i = GetWindowTextLength(eMain);
SetFocus(eMain);
SendMessage(eMain, EM_SETSEL, (WPARAM)i , (LPARAM)i);
SendMessage(eMain, EM_REPLACESEL, i, (LPARAM) (LPSTR) "\r\n");
SendMessage(eMain, EM_REPLACESEL, 0, (LPARAM) (LPSTR)packet.Message);
break;
/* I made my own socket class kindof, and eveyrthing in there appears to be right..i''m not sure if im doing things in my Edit Control (or whatever you call it) right though, I''m not sure if thats the right way to insert a newline before the message or not..
and also just pretent packet is a structure with the member Message which is a char array
Thanks for your guys'' help in advance
kag1
*/
Interesting.
What asynchronous I/O model is it? Is that WSAAsyncSelect?
Kuphryn
What asynchronous I/O model is it? Is that WSAAsyncSelect?
Kuphryn
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement