WinSock Program: Windows version of Server works but not embedded?
Hi.
I created a Server and a Client winsock application (MFC), and when i run them using the emulator (WinCE .Net 4.2), the Server don't seems to get any "OnAccept" callbacks.
However it works fine if i build and compile the Server into Windows version...
Any idea what's happening here?
By the way, i'm using CCeSocket class for Embedded and CSocket class for Windows.
Thanks.
In Whidbey, we have deprecated the CCeSocket classes originally found in eVC MFC and directly extended the CAsyncSocket class to work around the missing of Win32 API AsyncSelect on devices. With that change, your app targeting desktop Windows could be easily ported over to get it running on device with very minimal changes. I hightly recommend you give it a try.
I'm migrating my PPC2003 program to Visual Studio 2005, and have swapped my CCeSocket with CAsyncSocket. This works almost as it used to, except that the socket creation takes much longer at startup.
OnConnect():
if
(m_pSocket->Create()){
if(m_pSocket->Connect(m_strPcNettAdr,m_iPcPortNo)){OnConnect() is called from OnIdle():
BOOL CMyClass::OnIdle(LONG lCount) {
// try to connect if no connection
ConnectSocket();
if(!connected)
return(true);
return CWinApp::OnIdle(lCount);
}I've done some testing, and it seems that create() fails, leading to ConnectSocket() being called several times before actually connecting. Any ideas why? It did not use to be like this with CCeSocket, which connected instantly.