Advertisement

Win32 ASYNC problem

Started by April 26, 2004 01:14 PM
1 comment, last by kag1 20 years, 9 months ago
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
Advertisement
You didn''t forget a ''break'' or something in the switch statement, did you?

This topic is closed to new replies.

Advertisement