×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    1

    Send TCP/IP Data Periodically using CTimer

    Hi, I have posted the code below, I want to send data every 4 seconds

    When I runt he application it gives me KERN EXEC 0 ??

    TBool CContainerView::HandleRunMenuItemSelectedL( TInt aCommand )
    {

    RSocketServ* socketServer=new(ELeave)RSocketServ();
    RSocket* socket=new(ELeave)RSocket();
    socketServer->Connect();

    socket->Open(*socketServer,KAfInet, KSockStream,KProtocolInetTcp);

    CMyActiveObject* activeObject=CMyActiveObject::NewL();
    CleanupStack::PushL(activeObject);
    activeObject->NetworkRequest(socket,4000000);

    CleanupStack::Pop(activeObject);
    return ETrue;
    }

    void CMyActiveObject::NetworkRequest(RSocket* aSocket,TInt aInterval)
    {

    iSocket=aSocket;

    _LIT(KSocketPanic,"CMyActiveObject");
    __ASSERT_ALWAYS(!IsActive(),User::Panic(KSocketPanic,1));

    iSocket->Connect(*iPeerAddress,iStatus); //Here

    iInterval=aInterval;
    CTimer::After(iInterval);


    }
    void CMyActiveObject::RunL()
    {
    _LIT(HII,"GET /index.php?aaa")
    TBuf8<500> hi;
    hi.Copy(HII);

    iSocket->Send(hi,0,iStatus);
    After(iInterval);


    }
    void CMyActiveObject::ConstructL()

    {


    iPeerAddress->SetAddress(INET_ADDR(192,168,1,104));
    iPeerAddress->SetPort(80);

    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Send TCP/IP Data Periodically using CTimer

    you should propaby chekc the original sockets example, and also read symbian naming convention documentations. Basically R-Classes should not be constructd with new operator, instead just declare them similarlt as you would do with T-classes.

    The "KERN EXEC 0" means that you are trying to use R-Class object before it is connected/opened correctly. Thus check all error codes returned with connect/open functions, and also do debug and find which line is giving the error.

Similar Threads

  1. SPP Service - send data problem
    By sudhirbaliga in forum Bluetooth Technology
    Replies: 4
    Last Post: 2009-12-02, 10:55
  2. Want to send some data to server....
    By rohanwaugh in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2008-11-04, 10:02
  3. Cannot send data to the servlet in emulator!
    By sweetsweet24 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-10-08, 03:48
  4. How to send Content type to send data to server
    By Basu in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2006-10-23, 02:19
  5. how to send data at connection request phase over RSoceket using TCP protocol
    By madsum in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-10-04, 09:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×