ucommon
Public Member Functions | Protected Attributes
ucommon::sstream Class Reference

Secure socket using std::iostream. More...

#include <secure.h>

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

Public Member Functions

ssize_t _read (char *address, size_t size)
bool _wait (void)
ssize_t _write (char *address, size_t size)
void close (void)
 Close an active stream connection.
void flush (void)
bool is_secure (void)
void open (char *host, char *service, size_t size=536)
void release (void)
 Release the tcp stream and destroy the underlying socket.
 sstream (secure::client_t context)
 sstream (TCPServer *server, secure::server_t context, size_t size=536)
int sync ()
 Flush the stream input and output buffers, writes pending output.
- Public Member Functions inherited from ucommon::tcpstream
void open (Socket::address &address, unsigned segment=536)
 Open a stream connection to a tcp service.
void open (char *host, char *service, unsigned segment=536)
 Open a stream connectoion to a host and service.
 operator bool ()
 See if stream connection is active.
bool operator! ()
 See if stream is disconnected.
 tcpstream (tcpstream &copy)
 Copy constructor...
 tcpstream (TCPServer *server, unsigned segsize=536, timeout_t timeout=0)
 Create a stream from an existing tcp listener.
 tcpstream (int family=2, timeout_t timeout=0)
 Create an unconnected tcp stream object that is idle until opened.
 tcpstream (Socket::address &address, unsigned segsize=536, timeout_t timeout=0)
 A convenience constructor that creates a connected tcp stream directly from an address.
virtual ~tcpstream ()
 Destroy a tcp stream.
- Public Member Functions inherited from ucommon::StreamProtocol
bool is_open (void)
- Public Member Functions inherited from ucommon::CharacterProtocol
int get (void)
 Get the next character.
int put (int code)
 Put the next character.

Protected Attributes

secure::bufio_t bio
bool server
secure::session_t ssl
bool verify
- Protected Attributes inherited from ucommon::tcpstream
socket_t so
timeout_t timeout
- Protected Attributes inherited from ucommon::StreamProtocol
size_t bufsize
char * gbuf
char * pbuf

Additional Inherited Members

- Protected Member Functions inherited from ucommon::tcpstream
int _getch (void)
 This streambuf method is used to load the input buffer through the established tcp socket connection.
int _putch (int ch)
 This streambuf method is used to write the output buffer through the established tcp connection.
socket_t getsocket (void)

Detailed Description

Secure socket using std::iostream.

This class is similar to SSLBuffer but uses the libstdc++ library to stream i/o. Being based on tcpstream, it also inherits the character protocol. Like SSLBuffer, if no context is given or the handshake fails, then the stream defaults to insecure TCP connection behavior.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 641 of file secure.h.

Member Function Documentation

void ucommon::sstream::close ( void  )

Close an active stream connection.

This does not release the socket but is a disconnect.

Reimplemented from ucommon::tcpstream.

int ucommon::sstream::sync ( )

Flush the stream input and output buffers, writes pending output.

Returns
0 on success, or error code.

Reimplemented from ucommon::StreamProtocol.


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