rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWSecureSocketPortal Class Reference
[Secure Sockets]

An access point of a reliable byte stream communication channel that utilizes the SSL/TLS protocols for information security. More...

#include <rw/secsock/RWSecureSocketPortal.h>

Inheritance diagram for RWSecureSocketPortal:
RWPortal RWSocketPortalBase

List of all members.

Public Member Functions

 RWSecureSocketPortal ()
 RWSecureSocketPortal (const RWSockAddrBase &addr, const RWSecureSocketContext &context)
 RWSecureSocketPortal (const RWSockAddrBase &addr, const RWSecureSocketSession &sess, const RWSecureSocketContext &context)
 RWSecureSocketPortal (const RWSecureSocket &socket, WhoShouldClose=Portal)
RWSecureSocketSession getSession () const
void connect (const RWSockAddrBase &addr, const RWSecureSocketContext &context)
void connect (const RWSockAddrBase &addr, const RWSecureSocketSession &sess, const RWSecureSocketContext &context)
RWSecureSocket getSocket () const

Detailed Description

RWSecureSocketPortal is an access point of a reliable byte stream communication channel that utilizes the SSL/TLS protocols for information security. Multiple RWSecureSocketPortal instances can access the same communication channel. This often happens when using the copy constructor and assignment operator. Unless you specify otherwise during construction, when the last portal into a channel goes out of scope, the communication channel is closed and all.

RWSecureSocketPortal instances are lightweight objects. In addition, the copy and assign operations do not copy the underlying communication channel, so these operations are inexpensive. As a result, RWSecureSocketPortal instances can be returned by value and used as data members in objects.

RWSecureSocketPortal provides a secure socket implementation of a portal, implemented using the RWSecureSocket class. No state is added to RWPortal, so you can assign an RWSecureSocketPortal to an RWPortal without loss of data other than the type.


Constructor & Destructor Documentation

RWSecureSocketPortal::RWSecureSocketPortal (  ) 

Creates a secure socket portal. You must establish a connection using either connect() or the assignment operator before the portal can be used.

RWSecureSocketPortal::RWSecureSocketPortal ( const RWSockAddrBase addr,
const RWSecureSocketContext context 
)

Creates a secure socket portal connected to the addr, using the context provided.

RWSecureSocketPortal::RWSecureSocketPortal ( const RWSockAddrBase addr,
const RWSecureSocketSession sess,
const RWSecureSocketContext context 
)

Creates a secure socket portal connected to addr. Uses the context provided and attempts to reuse the session sess. If the session cannot be reused, a new session is established.

RWSecureSocketPortal::RWSecureSocketPortal ( const RWSecureSocket socket,
WhoShouldClose  = Portal 
)

Creates a secure socket portal to the communications channel represented by socket. Using this constructor is the only way to create a socket portal that does not close the underlying socket when no remaining portal references it.


Member Function Documentation

void RWSecureSocketPortal::connect ( const RWSockAddrBase addr,
const RWSecureSocketSession sess,
const RWSecureSocketContext context 
)

Connects self to the address using context, and attempts to reuse the session sess. If the session cannot be reused, a new session is established.

void RWSecureSocketPortal::connect ( const RWSockAddrBase addr,
const RWSecureSocketContext context 
)

Connects self to the address using context.

RWSecureSocketSession RWSecureSocketPortal::getSession (  )  const

Returns the session associated with this RWSecureSocketPortal. Applications should check the returned RWSecureSocketSession for validity using RWSecureSocketSession::isValid(). Returns one of the following:

RWSecureSocket RWSecureSocketPortal::getSocket (  )  const

Obtains a reference to the underlying secure socket.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.