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