|
MythTV master
|
Wraps a QTcpSocket to provide a blocking connect(), readLine(), and write() with a timeout. More...
#include <libmythupnp/blockingtcpsocket.h>
Public Member Functions | |
| BlockingTcpSocket ()=default | |
| bool | connect (const QHostAddress &address, quint16 port, std::chrono::milliseconds timeout) |
| Connect the socket to a host. More... | |
| QString | readLine (std::chrono::milliseconds timeout) |
| Read a whole line from the socket. More... | |
| qint64 | write (const char *data, qint64 size, std::chrono::milliseconds timeout) |
Private Attributes | |
| QTcpSocket | m_socket |
Wraps a QTcpSocket to provide a blocking connect(), readLine(), and write() with a timeout.
Definition at line 13 of file blockingtcpsocket.h.
|
default |
| bool BlockingTcpSocket::connect | ( | const QHostAddress & | address, |
| quint16 | port, | ||
| std::chrono::milliseconds | timeout | ||
| ) |
Connect the socket to a host.
Definition at line 6 of file blockingtcpsocket.cpp.
Referenced by UPnpEventTask::Execute(), UPNPSubscription::SendSubscribeRequest(), and UPNPSubscription::SendUnsubscribeRequest().
| QString BlockingTcpSocket::readLine | ( | std::chrono::milliseconds | timeout | ) |
Read a whole line from the socket.
The data will remain buffered in the socket until QIODevice::canReadLine() returns true.
| timeout | Total amount of time to wait. |
Definition at line 19 of file blockingtcpsocket.cpp.
Referenced by UPnpEventTask::Execute(), UPNPSubscription::SendSubscribeRequest(), and UPNPSubscription::SendUnsubscribeRequest().
| qint64 BlockingTcpSocket::write | ( | const char * | data, |
| qint64 | size, | ||
| std::chrono::milliseconds | timeout | ||
| ) |
Definition at line 41 of file blockingtcpsocket.cpp.
Referenced by UPnpEventTask::Execute(), UPNPSubscription::SendSubscribeRequest(), and UPNPSubscription::SendUnsubscribeRequest().
|
private |
Definition at line 32 of file blockingtcpsocket.h.
Referenced by connect(), readLine(), and write().