Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor sanjayk84's Avatar
    Join Date
    Apr 2008
    Posts
    87
    hi All


    i am try to log in xmpp client ,
    void login ()
    {
    LOGARG("%s", __func__);
    TRequestStatus aStatus;

    TInetAddr dst(TInetAddr(INET_ADDR(202,54,88,44), 5224)); //server IP and port

    User::LeaveIfError(iSocketServ.Connect());

    conSocket.Open(iSocketServ, KAfInet, KSockDatagram, KProtocolInetUdp);

    conSocket.Connect(dst,aStatus);

    User::WaitForRequest(aStatus);

    if (aStatus.Int() != KErrNone )
    {
    LOGARG("Connection Failed!\n",__func__);
    }

    _LIT8(KStart8, "<?xml version='1.0' encoding='utf-8'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='pr.mrtalk.com' version='1.0'>");

    conSocket.Write(KStart8(),aStatus);

    User::WaitForRequest(aStatus);

    if (aStatus.Int() != KErrNone )
    {
    LOGARG("Write Failed!",__func__);
    }
    LOGARG("Write Done!",__func__);

    TBuf8<100> buf8;

    TBuf<100> buf;

    conSocket.Read(buf8,aStatus);

    User::WaitForRequest(aStatus);

    if (aStatus.Int() != KErrNone )
    {
    LOGARG("Read Failed!",__func__);
    }

    buf.Copy(buf8);
    LOGDES16(buf);

    LOGARG("%s Done",__func__);

    }

    but i did not log in.

    what the problem ?

  2. #2
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Till which line you can go ... i mean is the log in failing or it is not sending any message at all.

  3. #3
    Regular Contributor sanjayk84's Avatar
    Join Date
    Apr 2008
    Posts
    87
    At the point of "Write Done! " is hang,

  4. #4
    Regular Contributor sanjayk84's Avatar
    Join Date
    Apr 2008
    Posts
    87
    i did not understand how to it use user name and password to log in.. i am just checked forum to how to connect

  5. #5
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    You will always have to assemble some longer stuff, and encode it with Base64. TImCodecB64 can do the encoding part.
    For example for the simplest mechanism, "PLAIN", this is pretty simple, as shown in #10 of http://discussion.forum.nokia.com/fo...nt-for-symbian

  6. #6
    Regular Contributor sanjayk84's Avatar
    Join Date
    Apr 2008
    Posts
    87
    hi Wizard_hu_
    i am waiting for you reply, thanks, i look before you example link, and make code according this, but i am getting hang in Write Done! (i am using static socketserv).

  7. #7
    Regular Contributor sanjayk84's Avatar
    Join Date
    Apr 2008
    Posts
    87
    Hi Wizard_hu_

    i am try to connect this way, his will connect and write and read,,
    but i did not understand how it logon...

    connect()
    {
    LOGARG("%s", __func__);

    _iSreambuffer.Append(_L("test@40gmail.com"));
    _iSreambuffer.Append(0);
    _iSreambuffer.Append(_L("test"));
    _iSreambuffer.Append(0);
    _iSreambuffer.Append(_L("med"));
    LOGARG("%s -Buffer Copy Done",__func__);
    TRequestStatus aStatus;
    TInetAddr address ;
    address.SetAddress(INET_ADDR(202,52,98,11));
    address.SetPort (5224);
    iSocketServ.Connect();
    conSocket.Open(iSocketServ, KAfInet, KSockStream, KProtocolInetTcp);

    conSocket.Connect(address,aStatus);
    User::WaitForRequest(aStatus);
    if (aStatus.Int() != KErrNone )
    {
    LOGARG("Connection Failed! %i",__func__,aStatus.Int());
    }

    LOGARG("Connection Done %i",__func__,aStatus.Int());

    /*_LIT8(KStart8, "<?xml version='1.0' encoding='utf-8'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams'xmlns='jabber:client' to='pr.mrtalk.com' version='1.0'>");*/


    conSocket.Write(KStart8,aStatus);
    User::WaitForRequest(aStatus);
    if (aStatus.Int() != KErrNone )
    {
    LOGARG("Write Failed!",__func__);
    }
    TBuf8<100> buf8;
    TBuf<256> buf_1;

    conSocket.Read(buf8,aStatus);

    User::WaitForRequest(aStatus);
    if (aStatus.Int() != KErrNone )
    {
    LOGARG("Read Failed!",__func__);
    }

    buf_1.Copy(KStart8);
    LOGDES16(buf_1);
    TInt ireclenght = buf8.Length();
    char* buf1;
    buf1 = descriptorToStringL(buf_1);

    if (ireclenght)
    {
    if (_xmppAccount->prs)
    {
    int ret = iks_parse(_xmppAccount->prs,buf1, ireclenght, 0);
    if (ret!= IKS_OK)
    {
    LOGARG("%s ret %i",__func__,ret);
    }
    else
    {
    LOGARG("%s No Parser ",__func__);
    }
    }
    }
    else
    {
    LOGARG("No Buffer",__func__);
    }

    LOGARG("%s Done",__func__);
    }

Similar Threads

  1. How to develop XMPP client for symbian
    By sumanthgwn in forum Symbian Networking & Messaging (Closed)
    Replies: 22
    Last Post: 2010-06-30, 17:19
  2. Xmpp Client
    By sanjayk84 in forum Symbian C++
    Replies: 15
    Last Post: 2010-06-23, 14:00
  3. Need Help: connecting j2me xmpp client program with openfire server
    By nandhagasc in forum Mobile Java General
    Replies: 1
    Last Post: 2010-05-21, 11:13
  4. [Moved] Need Help: connecting j2me xmpp client program with openfire server
    By nandhagasc in forum Mobile Java Networking & Messaging & Security
    Replies: 7
    Last Post: 2010-05-21, 10:50
  5. XMPP standard c/c++ client porting
    By Dmitry__ in forum Symbian C++
    Replies: 2
    Last Post: 2009-05-05, 14:43

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