MythTV
master
|
#include <bufferedsocketdevice.h>
Public Member Functions | |
BufferedSocketDevice (int nSocket) | |
BufferedSocketDevice (MSocketDevice *pSocket=nullptr, bool bTakeOwnership=false) | |
virtual | ~BufferedSocketDevice () |
MSocketDevice * | SocketDevice () |
void | SetSocketDevice (MSocketDevice *pSocket) |
void | SetDestAddress (QHostAddress hostAddress, quint16 nPort) |
bool | Connect (const QHostAddress &addr, quint16 port) |
void | Close () |
void | Flush () |
qint64 | Size () |
bool | At (qlonglong index) |
bool | AtEnd () |
qulonglong | BytesAvailable () |
qulonglong | WaitForMore (std::chrono::milliseconds msecs, bool *timeout=nullptr) |
qulonglong | BytesToWrite () const |
void | ClearPendingData () |
void | ClearReadBuffer () |
qlonglong | ReadBlock (char *data, qulonglong maxlen) |
qlonglong | WriteBlock (const char *data, qulonglong len) |
qlonglong | WriteBlockDirect (const char *data, qulonglong len) |
int | Getch () |
int | Putch (int ch) |
int | Ungetch (int ch) |
bool | CanReadLine () |
QString | ReadLine () |
QString | ReadLine (std::chrono::milliseconds msecs) |
qlonglong | ReadLine (char *data, qulonglong maxlen) |
quint16 | Port () const |
quint16 | PeerPort () const |
QHostAddress | Address () const |
QHostAddress | PeerAddress () const |
void | SetReadBufferSize (qulonglong bufSize) |
qulonglong | ReadBufferSize () const |
bool | IsValid () |
int | socket () |
Static Public Member Functions | |
static qint64 | At () |
Protected Member Functions | |
int | ReadBytes () |
bool | ConsumeWriteBuf (qulonglong nbytes) |
Protected Attributes | |
MSocketDevice * | m_pSocket {nullptr} |
qulonglong | m_nMaxReadBufferSize {0} |
qint64 | m_nWriteSize {0} |
write total buf size More... | |
qint64 | m_nWriteIndex {0} |
write index More... | |
bool | m_bHandleSocketDelete {true} |
QHostAddress | m_destHostAddress |
quint16 | m_nDestPort {0} |
MMembuf | m_bufRead |
std::deque< QByteArray * > | m_bufWrite |
Definition at line 38 of file bufferedsocketdevice.h.
|
explicit |
Definition at line 29 of file bufferedsocketdevice.cpp.
|
explicit |
Definition at line 49 of file bufferedsocketdevice.cpp.
|
virtual |
Definition at line 67 of file bufferedsocketdevice.cpp.
|
protected |
Definition at line 165 of file bufferedsocketdevice.cpp.
Referenced by At(), AtEnd(), BytesAvailable(), CanReadLine(), Close(), Getch(), ReadBlock(), and ReadLine().
|
protected |
Definition at line 218 of file bufferedsocketdevice.cpp.
Referenced by Flush().
MSocketDevice * BufferedSocketDevice::SocketDevice | ( | ) |
Definition at line 113 of file bufferedsocketdevice.cpp.
void BufferedSocketDevice::SetSocketDevice | ( | MSocketDevice * | pSocket | ) |
Definition at line 122 of file bufferedsocketdevice.cpp.
void BufferedSocketDevice::SetDestAddress | ( | QHostAddress | hostAddress, |
quint16 | nPort | ||
) |
Definition at line 136 of file bufferedsocketdevice.cpp.
bool BufferedSocketDevice::Connect | ( | const QHostAddress & | addr, |
quint16 | port | ||
) |
Definition at line 101 of file bufferedsocketdevice.cpp.
Referenced by UPnpEventTask::Execute().
void BufferedSocketDevice::Close | ( | ) |
Definition at line 76 of file bufferedsocketdevice.cpp.
Referenced by UPnpEventTask::Execute(), and ~BufferedSocketDevice().
void BufferedSocketDevice::Flush | ( | ) |
Definition at line 254 of file bufferedsocketdevice.cpp.
Referenced by Close(), WriteBlock(), and WriteBlockDirect().
qlonglong BufferedSocketDevice::Size | ( | ) |
Definition at line 323 of file bufferedsocketdevice.cpp.
|
static |
Definition at line 332 of file bufferedsocketdevice.cpp.
Referenced by ReadLine().
bool BufferedSocketDevice::At | ( | qlonglong | index | ) |
Definition at line 341 of file bufferedsocketdevice.cpp.
bool BufferedSocketDevice::AtEnd | ( | ) |
Definition at line 358 of file bufferedsocketdevice.cpp.
qulonglong BufferedSocketDevice::BytesAvailable | ( | ) |
Definition at line 373 of file bufferedsocketdevice.cpp.
Referenced by CanReadLine(), Size(), and WaitForMore().
qulonglong BufferedSocketDevice::WaitForMore | ( | std::chrono::milliseconds | msecs, |
bool * | timeout = nullptr |
||
) |
Definition at line 385 of file bufferedsocketdevice.cpp.
Referenced by ReadLine().
qulonglong BufferedSocketDevice::BytesToWrite | ( | ) | const |
Definition at line 437 of file bufferedsocketdevice.cpp.
void BufferedSocketDevice::ClearPendingData | ( | ) |
Definition at line 447 of file bufferedsocketdevice.cpp.
Referenced by Close().
void BufferedSocketDevice::ClearReadBuffer | ( | ) |
Definition at line 461 of file bufferedsocketdevice.cpp.
qlonglong BufferedSocketDevice::ReadBlock | ( | char * | data, |
qulonglong | maxlen | ||
) |
Definition at line 470 of file bufferedsocketdevice.cpp.
qlonglong BufferedSocketDevice::WriteBlock | ( | const char * | data, |
qulonglong | len | ||
) |
Definition at line 493 of file bufferedsocketdevice.cpp.
Referenced by Putch().
qlonglong BufferedSocketDevice::WriteBlockDirect | ( | const char * | data, |
qulonglong | len | ||
) |
Definition at line 528 of file bufferedsocketdevice.cpp.
Referenced by UPnpEventTask::Execute().
int BufferedSocketDevice::Getch | ( | ) |
Definition at line 549 of file bufferedsocketdevice.cpp.
int BufferedSocketDevice::Putch | ( | int | ch | ) |
Definition at line 572 of file bufferedsocketdevice.cpp.
int BufferedSocketDevice::Ungetch | ( | int | ch | ) |
Definition at line 583 of file bufferedsocketdevice.cpp.
bool BufferedSocketDevice::CanReadLine | ( | ) |
Definition at line 592 of file bufferedsocketdevice.cpp.
Referenced by ReadLine().
QString BufferedSocketDevice::ReadLine | ( | ) |
Definition at line 603 of file bufferedsocketdevice.cpp.
Referenced by UPnpEventTask::Execute(), and ReadLine().
QString BufferedSocketDevice::ReadLine | ( | std::chrono::milliseconds | msecs | ) |
Definition at line 628 of file bufferedsocketdevice.cpp.
qlonglong BufferedSocketDevice::ReadLine | ( | char * | data, |
qulonglong | maxlen | ||
) |
quint16 BufferedSocketDevice::Port | ( | ) | const |
Definition at line 673 of file bufferedsocketdevice.cpp.
quint16 BufferedSocketDevice::PeerPort | ( | ) | const |
Definition at line 685 of file bufferedsocketdevice.cpp.
QHostAddress BufferedSocketDevice::Address | ( | ) | const |
Definition at line 697 of file bufferedsocketdevice.cpp.
QHostAddress BufferedSocketDevice::PeerAddress | ( | ) | const |
Definition at line 711 of file bufferedsocketdevice.cpp.
void BufferedSocketDevice::SetReadBufferSize | ( | qulonglong | bufSize | ) |
Definition at line 147 of file bufferedsocketdevice.cpp.
qulonglong BufferedSocketDevice::ReadBufferSize | ( | ) | const |
Definition at line 156 of file bufferedsocketdevice.cpp.
|
inline |
Definition at line 115 of file bufferedsocketdevice.h.
|
inline |
Definition at line 116 of file bufferedsocketdevice.h.
Referenced by BufferedSocketDevice().
|
protected |
Definition at line 42 of file bufferedsocketdevice.h.
Referenced by Address(), AtEnd(), BufferedSocketDevice(), BytesAvailable(), Close(), Connect(), Flush(), Getch(), IsValid(), PeerAddress(), PeerPort(), Port(), ReadBlock(), ReadBytes(), SetSocketDevice(), socket(), SocketDevice(), WaitForMore(), and WriteBlockDirect().
|
protected |
Definition at line 44 of file bufferedsocketdevice.h.
Referenced by BufferedSocketDevice(), ReadBufferSize(), ReadBytes(), and SetReadBufferSize().
|
protected |
write total buf size
Definition at line 45 of file bufferedsocketdevice.h.
Referenced by BufferedSocketDevice(), BytesToWrite(), ClearPendingData(), ConsumeWriteBuf(), Flush(), and WriteBlock().
|
protected |
write index
Definition at line 46 of file bufferedsocketdevice.h.
Referenced by BufferedSocketDevice(), ClearPendingData(), ConsumeWriteBuf(), and Flush().
Definition at line 48 of file bufferedsocketdevice.h.
Referenced by BufferedSocketDevice(), Close(), and SetSocketDevice().
|
protected |
Definition at line 50 of file bufferedsocketdevice.h.
Referenced by Flush(), SetDestAddress(), and WriteBlockDirect().
|
protected |
Definition at line 51 of file bufferedsocketdevice.h.
Referenced by BufferedSocketDevice(), Flush(), SetDestAddress(), and WriteBlockDirect().
|
protected |
Definition at line 53 of file bufferedsocketdevice.h.
Referenced by At(), AtEnd(), CanReadLine(), ClearReadBuffer(), Close(), Getch(), ReadBlock(), ReadBytes(), ReadLine(), and Ungetch().
|
protected |
Definition at line 54 of file bufferedsocketdevice.h.
Referenced by ClearPendingData(), ConsumeWriteBuf(), Flush(), and WriteBlock().