UCommon
Public Member Functions | Protected Attributes
ucommon::SSLBuffer Class Reference

Secure socket buffer. More...

#include <secure.h>

Inheritance diagram for ucommon::SSLBuffer:
Inheritance graph
[legend]
Collaboration diagram for ucommon::SSLBuffer:
Collaboration graph
[legend]

Public Member Functions

bool _flush (void)
 Flush buffer to physical i/o.
bool _pending (void)
 Check for pending tcp or ssl data.
size_t _pull (char *address, size_t size)
 Method to pull buffer from physical i/o (read).
size_t _push (const char *address, size_t size)
 Method to push buffer into physical i/o (write).
void close (void)
 Close active connection.
bool is_secure (void) const
void open (const char *host, const char *service, size_t size=536)
 Connect a ssl client session to a specific host uri.
void release (void)
 Release (free) buffer memory.
 SSLBuffer (secure::client_t context)
 SSLBuffer (const TCPServer *server, secure::server_t context, size_t size=536)

Protected Attributes

secure::bufio_t bio
bool server
secure::session_t ssl
bool verify

Detailed Description

Secure socket buffer.

This is used to create ssl socket connections for both clients and servers. The use depends in part on the type of context created and passed at construction time. If no context is passed (NULL), then this reverts to TCPBuffer behavior.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 217 of file secure.h.


Member Function Documentation

bool ucommon::SSLBuffer::_pending ( void  ) [virtual]

Check for pending tcp or ssl data.

Returns:
true if data pending.

Reimplemented from ucommon::TCPBuffer.

size_t ucommon::SSLBuffer::_pull ( char *  address,
size_t  size 
) [virtual]

Method to pull buffer from physical i/o (read).

The address is passed to this virtual since it is hidden as private.

Parameters:
addressof buffer to pull data into.
sizeof buffer area being pulled..
Returns:
number of read written, 0 on error or end of data.

Reimplemented from ucommon::TCPBuffer.

size_t ucommon::SSLBuffer::_push ( const char *  address,
size_t  size 
) [virtual]

Method to push buffer into physical i/o (write).

The address is passed to this virtual since it is hidden as private.

Parameters:
addressof data to push.
sizeof data to push.
Returns:
number of bytes written, 0 on error.

Reimplemented from ucommon::TCPBuffer.

void ucommon::SSLBuffer::open ( const char *  host,
const char *  service,
size_t  size = 536 
)

Connect a ssl client session to a specific host uri.

If the socket was already connected, it is automatically closed first.

Parameters:
hostwe are connecting to.
serviceto connect to.
sizeof buffer and tcp fragments.

Reimplemented from ucommon::TCPBuffer.


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