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