SocketServer Des16Align 14

Login to reply to this topic.
Thu, 2004-11-18 16:45
Joined: 2004-09-06
Forum posts: 349
Does someone know what can be the cause of

Program closed:
SocketServer
Des 16Align 14

Sat, 2004-11-20 16:58
Joined: 2004-02-09
Forum posts: 7
Re: SocketServer Des16Align 14
Quote from: joape382
Does someone know what can be the cause of

Program closed:
SocketServer
Des 16Align 14

It means you are using emulator, possible Series 60 SDK 2.1. Yes?  Smiley
You will never see this bug on real device.

Denis Mingulov

Thu, 2005-03-03 13:11
Joined: 2005-02-28
Forum posts: 2
about des16align 14
Hi,

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
  • Login to reply to this topic.