LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 09-19-2011, 04:21 AM   #1
tarunchawla
Member
 
Registered: Mar 2010
Location: New Delhi,India
Distribution: Ubuntu 14.04
Posts: 117

Rep: Reputation: 3
chat client with gloox in c++


here I have written this code and when after compiling I run it ,it does not show connection is established or not please help me.....
connect here returns true but why onconnect function is not called


#include<iostream>
#include<gloox/jid.h>
#include<gloox/connectionlistener.h>
#include<gloox/client.h>

using namespace std;
using namespace gloox;
class clientublic ConnectionListener
{
public:
void start();
virtual bool onTLSConnect(const CertInfo& Info);
virtual void onConnect();
virtual void onDisconnect(ConnectionError e);
};
void client:nDisconnect(ConnectionError e){

}
void client::start()
{
JID *id=new JID("your email id");
//id->setServer("talk.google.com");
Client *cl=new Client(*id,"password");
cl->registerConnectionListener(this);
cl->connect();
}
void client:nConnect()
{
cout<<"connectoin established";
}


bool client:nTLSConnect(const CertInfo& Info)
{
cout<<"ok";
return true;
}
int main()
{
client c;
c.start();
}

compile it as g++ cliet.cpp -o cliet.o -lgloox -lpthread

Last edited by tarunchawla; 09-19-2011 at 04:26 AM.
 
  


Reply



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
making a chat client using gloox tarunchawla Programming 1 08-25-2011 05:00 AM
making a chat client using gloox in c++ tarunchawla Programming 1 08-23-2011 02:38 PM
[SOLVED] chat client in c using gloox library tarunchawla Programming 2 08-18-2011 06:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:51 AM.

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