XMPP/Jabber Client implementation
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: XMPP/Jabber Client implementation

  1. #1
    Join Date
    Apr 2007

    XMPP/Jabber Client implementation


    Im trying to implement a simple Jabber client app using C++.

    I understand that connection, handshake and user login happens through XML message streams.

    The code i have written is as follows :

    1) open socket
    iSocket = socket(AF_INET, iSocketType, 0);

    2) connect to server hosted on same machine ie. localhost
    if(connect(iSocket, (struct sockaddr*)&iSa, sizeof(iSa)) < 0)

    3) server handshake
    string str = "<?xml version='1.0'?> <stream to='' xmlns='jabber:client'/>";

    int result = send(iSocket, str.c_str(), strlen(str.c_str()), 0);
    if(result <= 0)
    result = recv(iSocket, str2, strlen(str2), 0);
    reply is :
    <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' id='1d01dbe8470a1700077872538724988a227c4f54' from='5222' xmlns='jabber:client'>t'>t

    My doubt is after this, any XML stream Im sending doesnt receive a reply

    I have tried different combinations.
    References :

    I even tried to extract the id received from reply in step 3 and constructed the stream. Tried instead of localhost.

    Please help.

  2. #2
    Join Date
    Nov 2008

    Re: XMPP/Jabber Client implementation

    check whether server is able receive the message sent from client or not.
    Post the code where ur sending it again.

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This a Codeguru.com survey!

HTML5 Development Center