×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Jun 2007
    Posts
    52

    Lightbulb Message not reaching to server through socket connection.

    Hi,
    I am able to make socket connection to my server,but when send message on the opened socket connection it's not reaching to server.Iam using the following code(Which is from S603rd/Ex) to write the message on socket (S60 3rd Edition Initial release).

    void CChatInet::SendMessageL( const TDesC& aText )
    {
    if ( State() != EConnected )
    {
    User::Leave( KErrDisconnected );
    }

    // stop reading socket
    if ( iActiveSocket )
    {
    iActiveSocket->CancelRead();
    }

    if ( IsActive() )
    {
    Cancel();
    }

    TBuf mandatoryformat;

    mandatoryformat.Copy(aText);

    SetState( ESendingMessage );
    HBufC* tempString = HBufC::NewL( mandatoryformat.Length() );

    tempString->Des().Copy( mandatoryformat );

    iMessage = HBufC8::NewL(tempString->Length());
    iMessage->Des().Copy( *tempString );
    // write message to socket
    if ( iActiveSocket )
    {
    iActiveSocket->Write( *iMessage, iStatus );
    }

    SetActive();
    }

    No panics with this code,But the data whatever im writing on the socket is not displaying on server(Means it's not flushed to server as i guess).But the data is reaching to server when i disconnect the client socket connection to server.
    So is there any solution like Flushing the data which is written on socket or something wrong with my code.
    I struck on this point ,please help in solving this.

    Thanks in Advance.
    Last edited by narsi27; 2009-09-18 at 11:39.

  2. #2
    Regular Contributor
    Join Date
    Jun 2007
    Posts
    52

    Re: Message not reaching to server through socket connection.

    Hi,
    My Problem got solved.As i was not given end delimeter(\r) at the end of the message So Write method is treating the message is not ended .That's why watever the message i wrote on the socket is not sent to server.
    Now the message is reaching to server properly.

Similar Threads

  1. XML onLoad with background http server problem
    By simonjuric in forum [Archived] Flash Lite on Nokia Devices
    Replies: 5
    Last Post: 2009-06-08, 16:47
  2. Socket or HTTP connection over Bluetooth- Nokia N70
    By Hiltarus in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2007-04-12, 14:55
  3. Socket connection to a remote server???
    By noussaENSI in forum Symbian Networking & Messaging (Closed)
    Replies: 14
    Last Post: 2007-03-14, 11:21
  4. Error message in socket connection
    By noussaENSI in forum Symbian Networking & Messaging (Closed)
    Replies: 12
    Last Post: 2007-03-05, 13:35
  5. Socket connection with 7650
    By nitingaur00 in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2002-12-25, 07:27

Posting Permissions

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