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 client:public ConnectionListener { public: void start(); virtual bool onTLSConnect(const CertInfo& Info); virtual void onConnect(); virtual void onDisconnect(ConnectionError e); }; void client::onDisconnect(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::onConnect() { cout<<"connectoin established"; } bool client::onTLSConnect(const CertInfo& Info) { cout<<"ok"; return true; } int main() { client c; c.start(); } compile it as g++ cliet.cpp -o cliet.o -lgloox -lpthread |
All times are GMT -5. The time now is 03:18 PM. |