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/mythlogging.h
"
8
#include "
libmythbase/mythsocket.h
"
9
#include "
libmythprotoserver/sockethandler.h
"
10
11
// MythMediaServer
12
#include "
controlrequesthandler.h
"
13
14
bool
ControlRequestHandler::AnnounceSocket
(
void
)
15
{
16
if
(!
m_socket
)
17
return
false
;
18
19
QString ann = QString(
"ANN MediaServer %1"
)
20
.arg(
gCoreContext
->
GetHostName
());
21
QStringList strlist(ann);
22
23
return
m_socket
->
Announce
(strlist);
24
}
25
38
bool
ControlRequestHandler::HandleQuery
(
SocketHandler
*
/*socket*/
,
39
QStringList &
/*commands*/
,
40
QStringList &
/*slist*/
)
41
{
42
bool
handled =
false
;
43
#if 0
44
QString command = commands[0];
45
46
if
(command ==
"GO_TO_SLEEP"
)
47
handled = HandleSleep();
48
else
if
(command ==
"SHUTDOWN_NOW"
)
49
handled = HandleShutdown();
50
#endif
51
52
return
handled;
53
}
ControlRequestHandler::HandleQuery
bool HandleQuery(SocketHandler *socket, QStringList &commands, QStringList &slist) override
Dispatch query messages received from a client.
Definition:
controlrequesthandler.cpp:38
ControlRequestHandler::AnnounceSocket
bool AnnounceSocket(void) override
Definition:
controlrequesthandler.cpp:14
MythSocket::Announce
bool Announce(const QStringList &new_announce)
Definition:
mythsocket.cpp:456
mythlogging.h
controlrequesthandler.h
sockethandler.h
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition:
mythcorecontext.cpp:55
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:842
mythsocket.h
Generated on Mon Nov 25 2024 03:16:20 for MythTV by
1.8.17