本文整理汇总了C++中QXmppConfiguration::setAutoReconnectionEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmppConfiguration::setAutoReconnectionEnabled方法的具体用法?C++ QXmppConfiguration::setAutoReconnectionEnabled怎么用?C++ QXmppConfiguration::setAutoReconnectionEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmppConfiguration
的用法示例。
在下文中一共展示了QXmppConfiguration::setAutoReconnectionEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connectHost
void QxmppPeer::connectHost( const std::string & jid, const std::string & password,
const std::string & host, int port, bool tls )
{
QXmppConfiguration conf;
conf.setJid( jid.c_str() );
conf.setPassword( password.c_str() );
if ( host.size() > 0 )
conf.setHost( host.c_str() );
if ( port > 0 )
conf.setPort( port );
conf.setAutoReconnectionEnabled( true );
//conf.setUseNonSASLAuthentication( true );
if ( tls )
conf.setStreamSecurityMode( QXmppConfiguration::TLSEnabled );
else
conf.setStreamSecurityMode( QXmppConfiguration::TLSDisabled );
connectToServer( conf );
}
示例2: main
int main(int argc,char* argv[])
{
QCoreApplication a(argc,argv);
QCoreApplication::setOrganizationName("H-Sec");
QCoreApplication::setOrganizationDomain("H-Sec.org");
QCoreApplication::setApplicationName("QHBot");
qInstallMsgHandler(mMsgOut);
QXmppLogger::getLogger()->setLoggingType(QXmppLogger::StdoutLogging);
QHBot bot;
QXmppConfiguration config;
QSettings settings("QHBot.ini",QSettings::IniFormat);
settings.beginGroup("Connection");
config.setHost(settings.value("Host").toString());
config.setDomain(settings.value("Domain").toString());
config.setUser(settings.value("User").toString());
config.setPassword(settings.value("Password").toString());
config.setPort(settings.value("Port").toInt());
config.setKeepAliveInterval(60);
config.setKeepAliveTimeout(15);
config.setAutoReconnectionEnabled(true);
//settings.endGroup(); FIXME: FIX PERMISOS
bot.connectToServer(config);
/* FIXME: FIX PERMISOS */
qDebug()<<"AdmList contiene: "<<settings.value("Admlist").toString();
QStringList admins(settings.value("Admlist").toString().split(" "));
bot.setAdminList(admins);
settings.endGroup();
/* FIXME: FIX PERMISOS */
return a.exec();
}