Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

SslConnection Class Reference

Manages the yucky low-level SSL connections to other nodes. More...

#include <SslConnection.h>

Inheritance diagram for SslConnection::

BasicObject ConnectionInterface ObservableInterface List of all members.

Public Methods

 SslConnection ()
virtual ~SslConnection ()
virtual SocketAddressgetSocketAddress ()
virtual void setSocketAddress (SocketAddress *)
virtual int connect ()
 Connect to the IP address/port that is internally stored in this node. More...

virtual void close ()
 Close the stream to this node. More...

virtual int listen ()
 Used to accept incoming connections. More...

virtual ConnectionInterfaceaccept ()
 Accept handles incoming connect requests. More...

virtual bool isConnected ()
 Return true if we are connected to this Node, false otherwise. More...

virtual bool isConnectedTo (IpAddress ipAddr)
 Return true if this nodes IP address matches the parameter, and we are currently connected to it. More...

virtual int getStream ()
virtual void setStream (int stream)
 You can only set the stream if it isnt being used. More...

virtual int read (unsigned char *buffer, int bufferSize, int amountToRead=0)
 Read data from the connection. More...

virtual int write (unsigned char *buffer, int amountToWrite)
 Write the data to the stream. More...

virtual ConnectionInterface::ObjectType getConnectionType ()
virtual void toStream (std::ostream &out)

Private Attributes

ConnectionInterfacem_connection
Sslm_sslStream
 ssl descriptor. More...


Detailed Description

Manages the yucky low-level SSL connections to other nodes.

Definition at line 23 of file SslConnection.h.


Constructor & Destructor Documentation

SslConnection::SslConnection
 

Definition at line 8 of file SslConnection.cpp.

Referenced by accept().

SslConnection::~SslConnection [virtual]
 

Definition at line 14 of file SslConnection.cpp.


Member Function Documentation

ConnectionInterface * SslConnection::accept [virtual]
 

Accept handles incoming connect requests.

Member function "listen" must be called before this function is called.

Returns:
The Connection accepted from if successful, NULL otherwise.

Reimplemented from ConnectionInterface.

Definition at line 167 of file SslConnection.cpp.

void SslConnection::close [virtual]
 

Close the stream to this node.

Reimplemented from ConnectionInterface.

Definition at line 204 of file SslConnection.cpp.

Referenced by connect(), and ~SslConnection().

int SslConnection::connect [virtual]
 

Connect to the IP address/port that is internally stored in this node.

Returns:
1 if successful, 0 if unsuccessful

Reimplemented from ConnectionInterface.

Definition at line 32 of file SslConnection.cpp.

ConnectionInterface::ObjectType SslConnection::getConnectionType [virtual]
 

Reimplemented from ConnectionInterface.

Definition at line 22 of file SslConnection.cpp.

SocketAddress * SslConnection::getSocketAddress [virtual]
 

Reimplemented from ConnectionInterface.

Definition at line 255 of file SslConnection.cpp.

Referenced by toStream().

int SslConnection::getStream void [virtual]
 

Returns:
the socket descriptor

Reimplemented from ConnectionInterface.

Definition at line 221 of file SslConnection.cpp.

bool SslConnection::isConnected [virtual]
 

Return true if we are connected to this Node, false otherwise.

Reimplemented from ConnectionInterface.

Definition at line 230 of file SslConnection.cpp.

Referenced by close().

bool SslConnection::isConnectedTo IpAddress ipAddr [virtual]
 

Return true if this nodes IP address matches the parameter, and we are currently connected to it.

Reimplemented from ConnectionInterface.

Definition at line 240 of file SslConnection.cpp.

int SslConnection::listen [virtual]
 

Used to accept incoming connections.

This sets up the socket to listen, but this does not start accepting connections. (It returns immediately)

Returns:
1 if successful, 0 if unsuccessful

Reimplemented from ConnectionInterface.

Definition at line 154 of file SslConnection.cpp.

int SslConnection::read unsigned char * buffer,
int bufferSize,
int amountToRead = 0
[virtual]
 

Read data from the connection.

Parameters:
buffer   Where to store the data read.
bufferSize   The size of the buffer in bytes.
amountToRead   The amount of data to read. The function will block until this much data has been read. If set to zero, the function will only block until it gets any amount of data.

Returns:
< 0 if there is an error, otherwise the number of bytes read

Reimplemented from ConnectionInterface.

Definition at line 77 of file SslConnection.cpp.

void SslConnection::setSocketAddress SocketAddress * socketAddress [virtual]
 

Reimplemented from ConnectionInterface.

Definition at line 261 of file SslConnection.cpp.

void SslConnection::setStream int stream [virtual]
 

You can only set the stream if it isnt being used.

Reimplemented from ConnectionInterface.

Definition at line 249 of file SslConnection.cpp.

void SslConnection::toStream std::ostream & out [virtual]
 

Reimplemented from BasicObject.

Definition at line 267 of file SslConnection.cpp.

int SslConnection::write unsigned char * buffer,
int amountToWrite
[virtual]
 

Write the data to the stream.

Returns:
Number of bytes written, or the error code from system-level "send".

Reimplemented from ConnectionInterface.

Definition at line 125 of file SslConnection.cpp.


Member Data Documentation

ConnectionInterface* SslConnection::m_connection [private]
 

Definition at line 48 of file SslConnection.h.

Ssl* SslConnection::m_sslStream [private]
 

ssl descriptor.

Definition at line 51 of file SslConnection.h.


The documentation for this class was generated from the following files:
Generated at Thu Jul 11 13:31:59 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001