29 #ifndef PT_SSL_IOSTREAM_H
30 #define PT_SSL_IOSTREAM_H
32 #include <Pt/Ssl/Api.h>
33 #include <Pt/Ssl/StreamBuffer.h>
34 #include <Pt/NonCopyable.h>
35 #include <Pt/IOStream.h>
60 , _sb(ctx, ios, mode, bufferSize)
73 { _sb.
open( ctx, ios, mode); }
130 std::streamsize
import(std::streamsize maxImport = 0)
131 {
return _sb.
import(maxImport); }
146 #endif // PT_SSL_IOSTREAM_H
void close()
Closes the stream buffer.
void setBuffer(BasicStreamBuffer< char > *sb)
Sets the buffer.
Definition: IOStream.h:175
SSL stream.
Definition: IOStream.h:43
bool readHandshake()
Reads handshake message from the underlying stream.
Definition: IOStream.h:102
Protects derived classes from being copied.
Definition: NonCopyable.h:54
bool isConnected() const
Returns true if connected to peer.
Definition: IOStream.h:87
SSL stream buffer.
Definition: StreamBuffer.h:47
bool isShutdown() const
Returns true if the shutown notify has to be completed.
Definition: IOStream.h:117
bool shutdown()
Shutdown the SSL connection.
Definition: IOStream.h:112
IOStream(std::size_t bufferSize=1024)
Construct an SSL stream.
Definition: IOStream.h:49
void open(Context &ctx, std::ios &ios, OpenMode mode)
Opens the stream buffer.
bool isClosed() const
Returns true if the connection is closed.
Definition: IOStream.h:122
void close()
Closes the stream.
Definition: IOStream.h:82
bool shutdown()
Shutdown the SSL connection.
bool isClosed() const
Returns true if the connection is closed.
Input/Output stream.
Definition: IOStream.h:141
Context for SSL connections.
Definition: Context.h:76
virtual ~IOStream()
Destructor.
Definition: IOStream.h:67
std::streamsize import(std::streamsize maxImport=0)
Reads user message from the underlying stream.
void open(Context &ctx, std::iostream &ios, OpenMode mode)
Opens the SSL stream.
Definition: IOStream.h:72
const char * currentCipher() const
Return the currently used cipher.
bool writeHandshake()
Writes a handshake message to the underlying stream.
bool writeHandshake()
Writes a handshake message to the underlying stream.
Definition: IOStream.h:94
bool isConnected() const
Returns true if connected to peer.
StreamBuffer & sslBuffer()
Returns the ssl buffer.
Definition: IOStream.h:135
bool isShutdown() const
Returns true if the shutown notify has to be completed.
OpenMode
Open mode for ssl I/O.
Definition: Context.h:52
IOStream(Context &ctx, std::iostream &ios, OpenMode mode, std::size_t bufferSize=1024)
Constructs an open SSL stream.
Definition: IOStream.h:58
const char * currentCipher() const
Returns the currently used cipher.
Definition: IOStream.h:77
bool readHandshake(std::streamsize maxRead=0)
Reads handshake message from the underlying stream.