本文整理汇总了C++中QXmppByteStreamIq::setError方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmppByteStreamIq::setError方法的具体用法?C++ QXmppByteStreamIq::setError怎么用?C++ QXmppByteStreamIq::setError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmppByteStreamIq
的用法示例。
在下文中一共展示了QXmppByteStreamIq::setError方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connectToNextHost
void QXmppTransferIncomingJob::connectToNextHost()
{
bool check;
Q_UNUSED(check);
if (m_streamCandidates.isEmpty()) {
// could not connect to any stream host
QXmppByteStreamIq response;
response.setId(m_streamOfferId);
response.setTo(m_streamOfferFrom);
QXmppStanza::Error error(QXmppStanza::Error::Cancel, QXmppStanza::Error::ItemNotFound);
error.setCode(404);
response.setType(QXmppIq::Error);
response.setError(error);
d->client->sendPacket(response);
terminate(QXmppTransferJob::ProtocolError);
return;
}
// try next host
m_candidateHost = m_streamCandidates.takeFirst();
info(QString("Connecting to streamhost: %1 (%2 %3)").arg(
m_candidateHost.jid(),
m_candidateHost.host(),
QString::number(m_candidateHost.port())));
const QString hostName = streamHash(d->sid,
d->jid,
d->client->configuration().jid());
// try to connect to stream host
m_candidateClient = new QXmppSocksClient(m_candidateHost.host(), m_candidateHost.port(), this);
m_candidateTimer = new QTimer(this);
check = connect(m_candidateClient, SIGNAL(disconnected()),
this, SLOT(_q_candidateDisconnected()));
Q_ASSERT(check);
check = connect(m_candidateClient, SIGNAL(ready()),
this, SLOT(_q_candidateReady()));
Q_ASSERT(check);
check = connect(m_candidateTimer, SIGNAL(timeout()),
this, SLOT(_q_candidateDisconnected()));
Q_ASSERT(check);
m_candidateTimer->setSingleShot(true);
m_candidateTimer->start(socksTimeout);
m_candidateClient->connectToHost(hostName, 0);
}