MythTV  master
sockethandler.cpp
Go to the documentation of this file.
1 #include <QStringList>
2 #include <utility>
3 
4 #include "sockethandler.h"
5 #include "mythlogging.h"
6 
8  QString hostname) :
9  ReferenceCounter("SocketHandler"),
10  m_blockShutdown(false), m_standardEvents(false),
11  m_systemEvents(false), m_socket(sock), m_parent(parent),
12  m_hostname(std::move(hostname))
13 {
14  if (m_socket)
15  m_socket->IncrRef();
16 }
17 
19 {
20  if (m_socket)
21  {
22  m_socket->DecrRef();
23  m_socket = nullptr;
24  }
25 }
26 
27 bool SocketHandler::WriteStringList(const QStringList &strlist)
28 {
29  if (!m_socket)
30  return false;
31 
32  return m_socket->WriteStringList(strlist);
33 }
34 
35 bool SocketHandler::SendReceiveStringList(QStringList &strlist,
36  uint min_reply_length)
37 {
38  if (!m_socket)
39  return false;
40 
41  return m_socket->SendReceiveStringList(strlist, min_reply_length);
42 }
bool WriteStringList(const QStringList &strlist)
General purpose reference counter.
unsigned int uint
Definition: compat.h:140
virtual int IncrRef(void)
Increments reference count.
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
SocketHandler(MythSocket *sock, MythSocketManager *parent, QString hostname)
string hostname
Definition: caa.py:17
MythSocket * m_socket
Definition: sockethandler.h:44
Class for communcating between myth backends and frontends.
Definition: mythsocket.h:26
bool SendReceiveStringList(QStringList &list, uint min_reply_length=0, uint timeoutMS=kLongTimeout)
Definition: mythsocket.cpp:336
bool SendReceiveStringList(QStringList &strlist, uint min_reply_length=0)
bool WriteStringList(const QStringList &list)
Definition: mythsocket.cpp:311