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 client
ublic 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