![]() |
CPPMyth
Library to interoperate with MythTV server
|


Public Member Functions | |
| int | GetErrNo () const |
| void | SetReadAttempt (int n) |
| virtual bool | Connect (const char *server, unsigned port, int rcvbuf) |
| virtual bool | SendData (const char *buf, size_t size) |
| virtual size_t | ReceiveData (void *buf, size_t n) |
| virtual size_t | BlockingRead (void *buf, size_t n) |
| virtual void | Disconnect () |
| virtual bool | IsValid () const |
| int | Listen (timeval *timeout) |
| net_socket_t | GetHandle () const |
| std::string | GetRemoteAddrInfo () |
| std::string | GetHostAddrInfo () |
| Public Member Functions inherited from NSROOT::NetSocket | |
| void | SetTimeout (timeval timeout) |
Static Public Member Functions | |
| static const char * | GetMyHostName () |
Protected Attributes | |
| net_socket_t | m_socket |
| int | m_rcvbuf |
| int | m_errno |
| int | m_attempt |
| Protected Attributes inherited from NSROOT::NetSocket | |
| struct timeval | m_timeout |
Private Member Functions | |
| TcpSocket (const TcpSocket &) | |
| TcpSocket & | operator= (const TcpSocket &) |
Private Attributes | |
| char * | m_buffer |
| char * | m_bufptr |
| size_t | m_buflen |
| size_t | m_rcvlen |
Friends | |
| class | TcpServerSocket |
| TcpSocket::TcpSocket | ( | ) |
Definition at line 98 of file socket.cpp.
|
virtual |
Definition at line 111 of file socket.cpp.
|
virtual |
Read data or block.
| buf | the pointer to write data |
| n | read at most n bytes |
Reimplemented in NSROOT::SecureSocket.
Definition at line 478 of file socket.cpp.
References IsValid().
|
virtual |
Try to connect the socket to an address name, port.
| server | the destination address name |
| port | the destination port |
| rcvbuf | the size of read buffer, else 0 for SOCKET_RCVBUF_MINSIZE |
Reimplemented in NSROOT::SecureSocket.
Definition at line 256 of file socket.cpp.
References Disconnect(), and IsValid().
|
virtual |
Gracefully disconnect the socket.
Reimplemented in NSROOT::SecureSocket.
Definition at line 503 of file socket.cpp.
References IsValid().
Referenced by Connect().

|
inline |
|
inline |
| std::string TcpSocket::GetHostAddrInfo | ( | ) |
Definition at line 578 of file socket.cpp.
References IsValid().
|
static |
Definition at line 597 of file socket.cpp.
| std::string TcpSocket::GetRemoteAddrInfo | ( | ) |
Definition at line 559 of file socket.cpp.
References IsValid().
|
virtual |
Definition at line 536 of file socket.cpp.
Referenced by NSROOT::TcpServerSocket::AcceptConnection(), BlockingRead(), Connect(), Disconnect(), GetHostAddrInfo(), GetRemoteAddrInfo(), Listen(), ReceiveData(), and SendData().

| int TcpSocket::Listen | ( | timeval * | timeout | ) |
Check for read readiness. It returns -1 for errors, 0 for occurred timeout, and >0 when incoming data are ready to read.
| timeout |
Definition at line 541 of file socket.cpp.
References IsValid().
|
virtual |
Read data from the socket.
| buf | the pointer to write received data |
| n | the number of byte to read |
Implements NSROOT::NetSocket.
Reimplemented in NSROOT::SecureSocket.
Definition at line 385 of file socket.cpp.
References IsValid().
|
virtual |
Send data into the socket.
| buf | the pointer to data |
| size | the number of byte to send |
Implements NSROOT::NetSocket.
Reimplemented in NSROOT::SecureSocket.
Definition at line 311 of file socket.cpp.
References IsValid().
|
inline |
Configure the number of timed out attempt reading the socket before returning.
| n | the number of attempt |
Definition at line 83 of file socket.h.
Referenced by NSROOT::TcpServerSocket::AcceptConnection().
