I'm using a MFC CAsyncSocket to do some network communication in a multi-threaded environment. After several hours of trying to get the accepted sockets to accept incoming data I came across a page that states that for a CAsyncSocket's OnReceive function to be called the socket has to be in the context of the main GUI thread. Moving it to the main GUI thread has allowed the socket to start receiving data.
My question is this: does anyone know of a workaround for this? The socket was on a GUI thread before and the OnAccept was being called fine. The accepted socket could be used to send data no problem, just couldn't receive anything. I'd rather not have to re-architect this part of the software if I can avoid it.