CPPMyth
Library to interoperate with MythTV server
Loading...
Searching...
No Matches
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)
size_t BlockingRead (void *buf, size_t n)
void Disconnect ()
bool IsCertificateValid (std::string &info)
const char * GetSSLError ()
Public Member Functions inherited from NSROOT::TcpSocket
int GetErrNo () const
void SetReadAttempt (int n)
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)

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.
char * m_errmsg
 error message buffer

Friends

class SSLSessionFactory
class SSLServerContext

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 102 of file securesocket.h.

Constructor & Destructor Documentation

◆ ~SecureSocket()

SecureSocket::~SecureSocket ( )
virtual

Definition at line 498 of file securesocket.cpp.

◆ SecureSocket()

SecureSocket::SecureSocket ( void * ssl)
private

Definition at line 489 of file securesocket.cpp.

Member Function Documentation

◆ BlockingRead()

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

Read data or block.

Parameters
bufthe pointer to write data
nread at most n bytes
Returns
the number of received byte

Reimplemented from NSROOT::TcpSocket.

Definition at line 517 of file securesocket.cpp.

◆ 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 502 of file securesocket.cpp.

◆ Disconnect()

void SecureSocket::Disconnect ( )
virtual

Gracefully disconnect the socket.

Reimplemented from NSROOT::TcpSocket.

Definition at line 531 of file securesocket.cpp.

◆ GetSSLError()

const char * SecureSocket::GetSSLError ( )

Definition at line 541 of file securesocket.cpp.

◆ IsCertificateValid()

bool SecureSocket::IsCertificateValid ( std::string & info)

Definition at line 535 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 510 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 524 of file securesocket.cpp.

◆ SSLServerContext

friend class SSLServerContext
friend

Definition at line 105 of file securesocket.h.

◆ SSLSessionFactory

friend class SSLSessionFactory
friend

Definition at line 104 of file securesocket.h.

Field Documentation

◆ m_cert

void* NSROOT::SecureSocket::m_cert
private

X509 certificate.

Definition at line 124 of file securesocket.h.

◆ m_connected

bool NSROOT::SecureSocket::m_connected
private

SSL session state.

Definition at line 125 of file securesocket.h.

◆ m_errmsg

char* NSROOT::SecureSocket::m_errmsg
private

error message buffer

Definition at line 127 of file securesocket.h.

◆ m_ssl

void* NSROOT::SecureSocket::m_ssl
private

SSL handle.

Definition at line 123 of file securesocket.h.

◆ m_ssl_error

int NSROOT::SecureSocket::m_ssl_error
private

SSL error code.

Definition at line 126 of file securesocket.h.


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