Hi All:
I have dev a local socket server on symbian 3rd edition, unfortunatly, it does not work well. it just correctlly accept the first request from client, and absolutly ignor all the following request. what happend and why?
server code:
CHttpSocketEngine is main class, derive from CActive
Code:void CHttpSocketEngine::StartListeningL(TInt myPort, TBool nomsg) { TInt err; err = iSocketServ.Connect(); if (err != KErrNone) { return; } if ((err = iServerSocket.Open(iSocketServ, KAfInet, KSockStream, KProtocolInetTcp)) != KErrNone) { iSocketServ.Close(); return; } if ((err = iServerSocket.SetLocalPort(myPort)) != KErrNone) { iServerSocket.Close(); iSocketServ.Close(); return; } if ((err = iServerSocket.Listen(1)) != KErrNone) { iServerSocket.Close(); iSocketServ.Close(); return; } if (iClientSocket.Open(iSocketServ) != KErrNone) { iServerSocket.Close(); iSocketServ.Close(); return; } iServerSocket.Accept(iClientSocket, iStatus); SetActive(); listening = ETrue; } void CHttpSocketEngine::RunL() { if (iStatus != KErrNone) { iClientSocket.Close(); iServerSocket.Close(); listening = EFalse; StartListeningL(EFalse); return; } HandleClientL(iClientSocket);// to handle the data iClientSocket.Close(); if(closing) { User::Exit(0); } if (iClientSocket.Open(iSocketServ) != KErrNone) { iServerSocket.Close(); iSocketServ.Close(); listening = EFalse; return; } // let the ServerSocket back to accept status,but actually, it does work, why iServerSocket.Accept(iClientSocket, iStatus); SetActive(); }
is it possible that some thing wrong with the client ? thx!



