本文整理汇总了C++中SocketHandler::WriteStringList方法的典型用法代码示例。如果您正苦于以下问题:C++ SocketHandler::WriteStringList方法的具体用法?C++ SocketHandler::WriteStringList怎么用?C++ SocketHandler::WriteStringList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SocketHandler
的用法示例。
在下文中一共展示了SocketHandler::WriteStringList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAnnounce
bool BaseRequestHandler::HandleAnnounce(MythSocket *socket,
QStringList &commands, QStringList &slist)
{
if (commands.size() != 4)
return false;
bool blockShutdown;
if (commands[1] == "Playback")
blockShutdown = true;
else if (commands[1] == "Monitor")
blockShutdown = false;
else
return false;
QString hostname = commands[2];
int eventlevel = commands[3].toInt();
bool systemevents = ( (eventlevel == 1) || (eventlevel == 3));
bool normalevents = ( (eventlevel == 1) || (eventlevel == 2));
SocketHandler *handler = new SocketHandler(socket, m_parent, hostname);
socket->SetAnnounce(slist);
handler->BlockShutdown(blockShutdown);
handler->AllowStandardEvents(normalevents);
handler->AllowSystemEvents(systemevents);
m_parent->AddSocketHandler(handler);
handler->WriteStringList(QStringList("OK"));
handler->DecrRef();
handler = NULL;
LOG(VB_GENERAL, LOG_DEBUG, QString("MainServer::ANN %1")
.arg(commands[1]));
LOG(VB_GENERAL, LOG_NOTICE, QString("adding: %1 as a client (events: %2)")
.arg(commands[2]).arg(eventlevel));
gCoreContext->SendSystemEvent(QString("CLIENT_CONNECTED HOSTNAME %1")
.arg(commands[2]));
return true;
}