StreamBuffer Class Reference

#include <Pt/Ssl/StreamBuffer.h>

SSL stream buffer.

Inherits BasicStreamBuffer< char >.

Public Member Functions

 StreamBuffer (std::size_t bufferSize=1024)
 Construct an SSL stream buffer.
 
 StreamBuffer (Context &ctx, std::ios &ios, OpenMode mode, std::size_t bufferSize=1024)
 Construct an SSL stream buffer..
 
virtual ~StreamBuffer ()
 Destructor.
 
void close ()
 Closes the stream buffer.
 
const char * currentCipher () const
 Return the currently used cipher.
 
std::streamsize import (std::streamsize maxImport=0)
 Reads user message from the underlying stream. More...
 
bool isClosed () const
 Returns true if the connection is closed.
 
bool isConnected () const
 Returns true if connected to peer.
 
bool isShutdown () const
 Returns true if the shutown notify has to be completed.
 
void open (Context &ctx, std::ios &ios, OpenMode mode)
 Opens the stream buffer.
 
std::streamsize out_avail ()
 Returns the number of characters buffered for output.
 
bool readHandshake (std::streamsize maxRead=0)
 Reads handshake message from the underlying stream. More...
 
void setPeerName (const std::string &peerName)
 Sets the expected peer name.
 
bool shutdown ()
 Shutdown the SSL connection. More...
 
std::streamsize speekn (char *buffer, std::streamsize size)
 Peek data in stream.
 
bool writeHandshake ()
 Writes a handshake message to the underlying stream. More...
 

Protected Member Functions

virtual std::streamsize showfull ()
 Returns the number of characters buffered for output.
 

Member Function Documentation

bool writeHandshake ( )

Returns true if handshake data was written, false if not.

bool readHandshake ( std::streamsize  maxRead = 0)

Returns true if more handshake data needs to be read, false if not.

bool shutdown ( )

If isShutdown() returned false, the shutdown message is written to the output. If isShutdown() returned true, or a previous call of shutdown() returned false, more data is required to read the shutdown reply. True is returned if the shutown was completed.

std::streamsize import ( std::streamsize  maxImport = 0)

Call isShutdown() to find out if a shutdown notify was received. Returns the number of bytes consumed from the underlyig stream.