|
|
User login
Feeds |
SocketServer Des16Align 14
|
|||||
| Thu, 2004-11-18 16:45 | |
Forum posts: 7
Program closed:
SocketServer
Des 16Align 14
It means you are using emulator, possible Series 60 SDK 2.1. Yes?
You will never see this bug on real device.
Denis Mingulov
Forum posts: 2
I have this problem developing with sdk 2.1 on reading from a tcp binded socket.
Debugging i can see that the tcp packet arrives with the right data, but the descriptor length is still 0!
Here I write the methods sources I wrote.
Initialize the listening socket
TUint CSocketEngine::SetListeningSocket()
{
TUint err;
err = iListeningSocket.Open(iSocketServ, KAfInet, KSockStream,
KProtocolInetTcp);
iListeningAddress.SetPort(PORT);
// Bind socket locally and set up listening queue on socket
err = iListeningSocket.Bind(iListeningAddress);
if (err != KErrNone)
{
CAknGlobalNote* aDlg = CAknGlobalNote::NewLC();
aDlg->ShowNoteL(EAknGlobalErrorNote, _L("Bind Error"));
CleanupStack::PopAndDestroy(aDlg);
return 1;
}
// Listen for connection from sender
err = iListeningSocket.Listen(1);
return 0;
}
After I start to receive packets
void CSocketEngine::ReceiveL()
{
if (!IsActive())
{
iRecvBuffer.Zero();
//TInt err = iListeningSocket.Listen(1);
// Create blank socket
iServiceSocket.Open(iSocketServ);
// Issue an accept
iListeningSocket.Accept(iServiceSocket, iStatus);
iEngineStatus = EAccepting;
SetActive();
}
//}
}
Now the RunL method
void CSocketEngine::RunL()
{
....
case EAccepting:
{
iServiceSocket.Recv(iRecvBuffer, NULL, iStatus);
iEngineStatus = EReceiving;
SetActive();
break;
}
case EReceiving:
if(iStatus == KErrNone) // Receive request ok
{
if (iRecvBuffer.Length() > 0)
{
....
}
ReceiveL();
}
else // Receive request failed
{
//CloseSubSessions();
}
break;
....
}
when the program goes in RunL and the state is EReceiving, iStatus is -25 (KErrEof).
Please help me, i don't know if is a emulator problem or it's the same on real device.
Thanks in advance for you suggestions