1. Did you call AfxSocketInit in your thread? You probably did since the socket connection is OK. 2. Does your thread have a message pump? The OnReceive event depends on windows messages. If your thread does not have a message pump, then the event will never be fired. The simplest way to add a message pump is create a modal dialog (hide it if you wish) from the thread after the socket connection. ::MessageBox(NULL, _T("I am a message pump for the socket"), NULL, MB_OK); Good luck.[
My articles and software tools
](http://hometown.aol.com/XiangYangL/)