30 #ifndef PT_SSL_StreamBuffer_H
31 #define PT_SSL_StreamBuffer_H
33 #include <Pt/Ssl/Api.h>
34 #include <Pt/Ssl/Context.h>
35 #include <Pt/StreamBuffer.h>
148 std::streamsize
import(std::streamsize maxImport = 0);
152 virtual std::streamsize showmanyc();
161 virtual int_type underflow();
164 virtual int_type overflow(int_type ch);
168 std::string _peerName;
169 std::size_t _ibufferSize;
171 std::size_t _obufferSize;
174 static const int _pbmax = 4;
181 #endif // PT_SSL_StreamBuffer_H
Core module.
Definition: Allocator.h:33
StreamBuffer(Context &ctx, std::ios &ios, OpenMode mode, std::size_t bufferSize=1024)
Creates an SSL stream buffer and opens it.
bool writeHandshake()
Writes a handshake message to the underlying stream.
void close()
Closes the stream buffer without a TLS shutdown.
StreamBuffer(std::size_t bufferSize=1024)
Creates a closed SSL stream buffer.
virtual ~StreamBuffer()
Destructor.
bool isClosed() const
Returns true if the connection was closed prematurely.
bool shutdown()
Completes or starts the TLS shutdown.
SSL stream buffer.
Definition: StreamBuffer.h:73
const char * currentCipher() const
Returns the cipher in use, or a placeholder if not connected.
void open(Context &ctx, std::ios &ios, OpenMode mode)
Opens the stream buffer on ios using ctx and mode.
void setPeerName(const std::string &peerName)
Sets the name expected in the peer certificate.
Buffer for input and output streams.
Definition: StreamBuffer.h:52
virtual std::streamsize showfull()
Returns the number of characters buffered for output.
bool isConnected() const
Returns true if the handshake has completed.
bool readHandshake(std::streamsize maxRead=0)
Reads a handshake message from the underlying stream.
OpenMode
Open mode for an SSL stream.
Definition: Context.h:56
bool isShutdown() const
Returns true if a shutdown alert was received.
Represents a connection between a Signal/Delegate and a slot.
Definition: Connection.h:96
Shared configuration for SSL connections.
Definition: Context.h:113