Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor srkreddy999's Avatar
    Join Date
    Sep 2005
    Posts
    57
    hi,

    i made a symbian client.in this client i connects to a server and i write a message.while i am writing a message to the server,if the GPRS connection is lost,how can i know whether the data is writen or not.

    this is the code i am using

    RSocketServ iSocketServ;
    RSocket iSocket;
    iSocketServ.Connect();

    void CSocket::ConnectL()
    {
    TInetAddr addr;
    if ( addr.Input( KDefaultServerName ) == KErrNone )
    {
    // server name is already a valid ip address
    User::LeaveIfError( iSocket.Open( iSocketServ,
    KAfInet,
    KSockStream,
    KProtocolInetTcp ) );
    // Set up address information
    iAddress.SetPort( KDefaultPortNumber );
    iAddress.SetAddress( addr.Address() );
    // Initiate socket connection
    iSocket.Connect( iAddress, iStatus );
    //writing to server
    iSocket.Write(_L8("some temp"), iStatus );
    }
    }


    how can i know whether the socket is connected or failed while connecting or failed while writing

    can any onw help out in this.

    Thanks and Regards,

  2. #2
    Regular Contributor trafcam's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, Great Britain
    Posts
    98
    As I understand it, you should implement this as an active object. You can then deal with problems like that in your RunL() function where the socket server will signal disconnection etc.

  3. #3
    Registered User ashish407's Avatar
    Join Date
    Oct 2004
    Posts
    4
    iSocket.Write(..., iStatus)... if the network fails during the Write, corresponding RunL for the iStatus is expected to return the error.

Similar Threads

  1. Getting started with Carbide.vs -- running the app
    By ET3D in forum Symbian Tools & SDKs
    Replies: 6
    Last Post: 2005-11-23, 17:45
  2. Socket problem
    By defragger in forum Python
    Replies: 0
    Last Post: 2005-08-25, 08:16
  3. status of socket
    By arthig in forum Symbian C++
    Replies: 0
    Last Post: 2005-05-17, 10:57
  4. Socket TCP status ?
    By curcio1 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-06-14, 09:59
  5. Help!!How can I detect socket status!!??
    By vphong in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2002-12-30, 00:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved