×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    87

    xmpp client login

    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
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: xmpp client login

    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
    Join Date
    Apr 2008
    Posts
    87

    Re: xmpp client login

    At the point of "Write Done! " is hang,

  4. #4
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    87

    Re: xmpp client login

    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
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: xmpp client login

    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
    Join Date
    Apr 2008
    Posts
    87

    Re: xmpp client login

    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
    Join Date
    Apr 2008
    Posts
    87

    Re: xmpp client login

    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
    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
    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
  •  
×