×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    16

    How can i determine if RSocket is connected?

    I'm trying to determine if the iSocket is connected or not
    to an ip but whenevver I tried to change the valu of the port
    and KInetAddr with an invalid value I'm still always getting
    a KErrNone value with the return value of iStatus?

    Or I'm just doing it the wrong way.

    Code:
    TInt CSocketLibrary::Connect()
    	{
    	Cancel();
    	iSocket.CancelConnect();
    	iState = EInitialized;
    	const TUint32 KInetAddr = INET_ADDR(127,0,0,1);
    	iAddress.SetPort(80);
    	iAddress.SetAddress(KInetAddr);
    	iSocket.Connect(iAddress,iStatus);
    	SetActive();
    	return iStatus.Int();
    	}
    And how do I transmit and receive data from the server?
    any sample would be really appreciated. Thanks.

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

    Re: How can i determine if RSocket is connected?

    you should wait untill the RunL function is called, then you can see with the iStatus.Int(); if the Connect was succesfull or not. For more information so check Active objects documentation.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    16

    Re: How can i determine if RSocket is connected?

    Quote Originally Posted by symbianyucca View Post
    you should wait untill the RunL function is called, then you can see with the iStatus.Int(); if the Connect was succesfull or not. For more information so check Active objects documentation.
    Thanks a lot

  4. #4
    Registered User
    Join Date
    Jun 2008
    Location
    India
    Posts
    1,048

    Re: How can i determine if RSocket is connected?

    If (iStatus==KErrNone)
    {
    Socket id connected
    }
    else
    {
    Any systemwide error code
    }

Similar Threads

  1. problem in closing RSocket
    By pornima in forum Symbian
    Replies: 2
    Last Post: 2009-02-13, 13:07
  2. RSocket Connection Problem
    By johnswyen in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2008-11-03, 16:58
  3. Connected Phone Was Not Recognized
    By tanginaka in forum General Development Questions
    Replies: 4
    Last Post: 2008-10-14, 08:55
  4. RSocket :: Connect -> KErrNone while no connection could be made???
    By janknepper in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-01-09, 17:12
  5. RecvOneOrMore to 1st RSocket causes KErrEof on 2nd RSocket
    By edelsesto in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2003-11-10, 16:46

Posting Permissions

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