×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Sep 2005
    Posts
    57

    finding the status of socket

    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
    Join Date
    Jun 2003
    Location
    Cheshire, Great Britain
    Posts
    98

    Re: finding the status of socket

    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
    Join Date
    Oct 2004
    Posts
    4

    Re: finding the status of socket

    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 Symbian
    Replies: 0
    Last Post: 2005-08-25, 08:16
  3. status of socket
    By arthig in forum Symbian
    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
  •  
×