MythTV  master
controlrequesthandler.cpp
Go to the documentation of this file.
1 #include <QString>
2 #include <QStringList>
3 
4 #include "mythsocket.h"
5 #include "sockethandler.h"
6 #include "mythlogging.h"
7 #include "mythcorecontext.h"
8 
10 
12 {
13  if (!m_socket)
14  return false;
15 
16  QString ann = QString("ANN MediaServer %1")
17  .arg(gCoreContext->GetHostName());
18  QStringList strlist(ann);
19 
20  return m_socket->Announce(strlist);
21 }
22 
36  QStringList &/*commands*/,
37  QStringList &/*slist*/)
38 {
39  bool handled = false;
40 #if 0
41  QString command = commands[0];
42 
43  if (command == "GO_TO_SLEEP")
44  handled = HandleSleep();
45  else if (command == "SHUTDOWN_NOW")
46  handled = HandleShutdown();
47 #endif
48 
49  return handled;
50 }
ControlRequestHandler::HandleQuery
bool HandleQuery(SocketHandler *socket, QStringList &commands, QStringList &slist) override
Dispatch query messages received from a client.
Definition: controlrequesthandler.cpp:35
ControlRequestHandler::AnnounceSocket
bool AnnounceSocket(void) override
Definition: controlrequesthandler.cpp:11
MythSocket::Announce
bool Announce(const QStringList &new_announce)
Definition: mythsocket.cpp:472
mythlogging.h
controlrequesthandler.h
sockethandler.h
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
mythcorecontext.h
OutboundRequestHandler::m_socket
MythSocket * m_socket
Definition: outboundhandler.h:30
SocketHandler
Definition: sockethandler.h:17
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:859
mythsocket.h