Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-22-2010, 07:45 AM   #1
Registered: Feb 2007
Location: Bangalore, India
Distribution: Ubuntu Feisty, Fedora 6 dual boot
Posts: 36

Rep: Reputation: 15
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='' 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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
XMPP (Jabber) Servers sounding board vortechs Linux - Server 5 02-04-2009 10:00 PM
icq,skype,yahoo messenger,... found no xmpp/jabber or "other" field in prefernces lomix LQ Suggestions & Feedback 1 04-01-2008 10:27 AM
Does Any Jabber Client Mark7 Linux - Software 2 02-16-2008 03:18 PM
LXer: Jive to Release XMPP Client as Open Source LXer Syndicated Linux News 0 06-11-2006 12:33 PM
i need help with a jabber client Little Wings Linux - Software 1 08-01-2004 10:11 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration