Dv::Ssl::Buffer Class Reference

A streambuf class for use with Dv::Ssl::Socket iostream objects. More...

#include <sslbuffer.h>

Inheritance diagram for Dv::Ssl::Buffer:

Inheritance graph
[legend]
Collaboration diagram for Dv::Ssl::Buffer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Buffer (Context &context, int fd, size_t inbufsize=1024, size_t outbufsize=1024, int msecs=0, unsigned int min_debug_level=0, Debugable *debug_master=0)
 Constructor.
 ~Buffer ()
 Destructor.
void * ssl () const
 Return pointer to SSL object.
const char * cipher () const
 Return string representation of cypher.
int iwait () const
 Wait for input to become available.

Protected Member Functions

virtual int rread (char *buf, size_t len)
 Raw read implementation.
virtual int rwrite (char *buf, size_t len)
 Raw write implementation, see Dv::Util::fdstreambuf.

Private Attributes

void * ssl_
 Opaque pointer to SSL object.

Detailed Description

A streambuf class for use with Dv::Ssl::Socket iostream objects.

Definition at line 14 of file sslbuffer.h.


Constructor & Destructor Documentation

Dv::Ssl::Buffer::Buffer ( Context context,
int  fd,
size_t  inbufsize = 1024,
size_t  outbufsize = 1024,
int  msecs = 0,
unsigned int  min_debug_level = 0,
Debugable debug_master = 0 
)

Constructor.

Parameters:
context 
See also:
Dv::Ssl::Context
Parameters:
fd underlying filedescriptor
inbufsize size of input buffer
outbufsize size of input buffer
msecs max timeout value in millisecs.
min_debug_level if a debug_master is connected, logging info will only be written if the master's level is at least min_debug_level
debug_master from where debug info will be taken
See also:
Dv::DebugSlave

Dv::Ssl::Buffer::~Buffer (  ) 

Destructor.


Member Function Documentation

void* Dv::Ssl::Buffer::ssl (  )  const [inline]

Return pointer to SSL object.

The return type is declared as void* to avoid inclusion of the openssl h header files.

Returns:
(opaque) pointer to SSL object with which this buffer communicates.

Definition at line 37 of file sslbuffer.h.

References ssl_.

const char* Dv::Ssl::Buffer::cipher (  )  const

Return string representation of cypher.

Returns:
string representation of cypher used by this buffer.

int Dv::Ssl::Buffer::iwait (  )  const [virtual]

Wait for input to become available.

This function is a specialisation of Dv::Util::fdstreambuf::iwait which first uses SSL_pending to check whether bytes for reading are available in the underlying SSL object. Only if this fails does it call Dv::Util::fdstreambuf::iwait.

Returns:
1 if input is available

0 if a timeout occurred

-1 if an error condition exists (e.g. underlying fd not set)

See also:
Dv::Util::fdstreambuf::iwait

Reimplemented from Dv::Util::fdstreambuf.

virtual int Dv::Ssl::Buffer::rread ( char *  buf,
size_t  len 
) [protected, virtual]

Raw read implementation.

Parameters:
buf to read into
len number of bytes to read
Returns:
number of chars read

0 on EOF

-1 on error

See also:
Dv::Util::fdstreambuf:rread

Reimplemented from Dv::Util::fdstreambuf.

virtual int Dv::Ssl::Buffer::rwrite ( char *  buf,
size_t  len 
) [protected, virtual]

Raw write implementation, see Dv::Util::fdstreambuf.

Parameters:
buf to write from
len number of bytes to write
Returns:
number of chars written

-1 on error

See also:
Dv::Util::fdstreambuf:rwrite

Reimplemented from Dv::Util::fdstreambuf.


Member Data Documentation

void* Dv::Ssl::Buffer::ssl_ [private]

Opaque pointer to SSL object.

Definition at line 72 of file sslbuffer.h.

Referenced by ssl().


The documentation for this class was generated from the following file:
dvssl-0.6.1 [15 March, 2008]