5 #include <QHostAddress> 34 bool use_shared_thread =
false);
36 bool ConnectToHost(
const QString &
hostname, quint16 port);
37 bool ConnectToHost(
const QHostAddress &address, quint16 port);
38 void DisconnectFromHost(
void);
41 bool error_dialog_desired =
false);
44 bool Announce(
const QStringList &strlist);
46 void SetAnnounce(
const QStringList &strlist);
50 { m_disableReadyReadCallback.fetchAndStoreOrdered((enabled) ? 0 : 1); }
52 bool SendReceiveStringList(
53 QStringList &list,
uint min_reply_length = 0,
54 uint timeoutMS = kLongTimeout);
56 bool ReadStringList(QStringList &list,
uint timeoutMS = kShortTimeout);
57 bool WriteStringList(
const QStringList &list);
59 bool IsConnected(
void)
const;
60 bool IsDataAvailable(
void)
const;
62 QHostAddress GetPeerAddress(
void)
const;
63 int GetPeerPort(
void)
const;
64 int GetSocketDescriptor(
void)
const;
67 int Write(
const char*,
int size);
68 int Read(
char*,
int size,
int max_wait_ms);
75 void CallReadyRead(
void);
78 void ConnectHandler(
void);
80 void AboutToCloseHandler(
void);
81 void DisconnectHandler(
void);
82 void ReadyReadHandler(
void);
83 void CallReadyReadHandler(
void);
85 void ReadStringListReal(QStringList *list,
uint timeoutMS,
bool *ret);
86 void WriteStringListReal(
const QStringList *list,
bool *ret);
87 void ConnectToHostReal(QHostAddress address, quint16 port,
bool *ret);
88 void DisconnectFromHostReal(
void);
90 void WriteReal(
const char*,
int size,
int *ret);
91 void ReadReal(
char*,
int size,
int max_wait_ms,
int *ret);
94 void IsDataAvailableReal(
bool *ret)
const;
static QMutex s_loopbackCacheLock
This is a wrapper around QThread that does several additional things.
QStringList GetAnnounce(void) const
static const uint kLongTimeout
#define kMythSocketLongTimeout
General purpose reference counter.
void SetReadyReadCallbackEnabled(bool enabled)
qt_socket_fd_t m_socketDescriptor
QAtomicInt m_disableReadyReadCallback
static MThread * s_thread
QHostAddress m_peerAddress
QAtomicInt m_dataAvailable
This is used internally as a hint that there might be data available for reading.
static const int kSocketReceiveBufferSize
static QMutex s_thread_lock
MythSocketCBs * m_callback
bool IsValidated(void) const
static const uint kShortTimeout
static QHash< QString, QHostAddress::SpecialAddress > s_loopbackCache
Class for communcating between myth backends and frontends.
static int ErrorHandler(Display *d, XErrorEvent *xeev)
bool IsAnnounced(void) const