CPPMyth
Library to interoperate with MythTV server
NSROOT::SecureSocket Class Reference
Inheritance diagram for NSROOT::SecureSocket:
Collaboration diagram for NSROOT::SecureSocket:

Public Member Functions

bool Connect (const char *server, unsigned port, int rcvbuf)
 
bool SendData (const char *buf, size_t size)
 
size_t ReceiveData (void *buf, size_t n)
 
void Disconnect ()
 
bool IsValid () const
 
bool IsCertificateValid (std::string &info)
 
- Public Member Functions inherited from NSROOT::TcpSocket
int GetErrNo () const
 
void SetReadAttempt (int n)
 
int Listen (timeval *timeout)
 
net_socket_t GetHandle () const
 
std::string GetHostAddrInfo ()
 
- Public Member Functions inherited from NSROOT::NetSocket
void SetTimeout (timeval timeout)
 

Private Member Functions

 SecureSocket (void *ssl)
 

Private Attributes

void * m_ssl
 SSL handle.
 
void * m_cert
 X509 certificate.
 
bool m_connected
 SSL session state.
 
int m_ssl_error
 SSL error code.
 

Friends

class SSLSessionFactory
 

Additional Inherited Members

- Static Public Member Functions inherited from NSROOT::TcpSocket
static const char * GetMyHostName ()
 
- Protected Attributes inherited from NSROOT::TcpSocket
net_socket_t m_socket
 
int m_rcvbuf
 
int m_errno
 
int m_attempt
 
- Protected Attributes inherited from NSROOT::NetSocket
struct timeval m_timeout
 

Detailed Description

Definition at line 52 of file securesocket.h.

Member Function Documentation

◆ Connect()

bool SecureSocket::Connect ( const char *  server,
unsigned  port,
int  rcvbuf 
)
virtual

Try to connect the socket to an address name, port.

Parameters
serverthe destination address name
portthe destination port
rcvbufthe size of read buffer, else 0 for SOCKET_RCVBUF_MINSIZE
Returns
true on success, else false

Reimplemented from NSROOT::TcpSocket.

Definition at line 351 of file securesocket.cpp.

◆ Disconnect()

void SecureSocket::Disconnect ( )
virtual

Gracefully disconnect the socket.

Reimplemented from NSROOT::TcpSocket.

Definition at line 373 of file securesocket.cpp.

◆ IsValid()

bool SecureSocket::IsValid ( ) const
virtual
Returns
true when socket is connected, else false

Reimplemented from NSROOT::TcpSocket.

Definition at line 377 of file securesocket.cpp.

◆ ReceiveData()

size_t SecureSocket::ReceiveData ( void *  buf,
size_t  n 
)
virtual

Read data from the socket.

Parameters
bufthe pointer to write received data
nthe number of byte to read
Returns
the number of received byte

Reimplemented from NSROOT::TcpSocket.

Definition at line 359 of file securesocket.cpp.

◆ SendData()

bool SecureSocket::SendData ( const char *  buf,
size_t  size 
)
virtual

Send data into the socket.

Parameters
bufthe pointer to data
sizethe number of byte to send
Returns
true when succeeded, else false

Reimplemented from NSROOT::TcpSocket.

Definition at line 366 of file securesocket.cpp.


The documentation for this class was generated from the following files: