MythTV
master
mythtv
programs
mythmediaserver
controlrequesthandler.cpp
Go to the documentation of this file.
1
// Qt
2
#include <QString>
3
#include <QStringList>
4
5
// MythTV
6
#include "
libmythbase/mythcorecontext.h
"
7
#include "
libmythbase/mythsocket.h
"
8
#include "
libmythprotoserver/sockethandler.h
"
9
10
// MythMediaServer
11
#include "
controlrequesthandler.h
"
12
13
bool
ControlRequestHandler::AnnounceSocket
(
void
)
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
37
bool
ControlRequestHandler::HandleQuery
(
SocketHandler
*
/*socket*/
,
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
Generated on Wed Feb 26 2025 03:18:06 for MythTV by
1.8.17