SourcePro® 2023.1 |
SourcePro® API Reference Guide |
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>
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) | |
void | connect (const RWSockAddrBase &addr, const RWSecureSocketContext &context) |
void | connect (const RWSockAddrBase &addr, const RWSecureSocketSession &sess, const RWSecureSocketContext &context) |
RWSecureSocketSession | getSession () const |
RWSecureSocket | getSocket () const |
Public Member Functions inherited from RWPortal | |
RWPortal () | |
RWPortal (const RWPortal &x) | |
~RWPortal () | |
RWPortal & | operator= (const RWPortal &x) |
RWNetBuf | recv () const |
int | recv (char *buf, int bufLen, RWNetBuf::State *state=0) const |
RWNetBuf | recvAtLeast (int n) const |
int | recvAtLeast (char *buf, int bufLen, int n, RWNetBuf::State *state=0) const |
int | send (const RWCString &s) const |
int | send (const char *buf, int buflen) const |
int | sendAtLeast (const char *buf, int bufLen, int n) const |
void | sendAtLeast (const char *buf, int bufLen) const |
int | sendAtLeast (const RWCString &s, int n) const |
void | sendAtLeast (const RWCString &s) const |
Additional Inherited Members | |
Public Types inherited from RWSocketPortalBase | |
enum | WhoShouldClose { Portal, Application } |
Protected Member Functions inherited from RWPortal | |
RWPortal (RWPortalImp *impl) | |
const RWPortalImp * | implementation () const |
RWPortalImp * | implementation () |
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.
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.
void RWSecureSocketPortal::connect | ( | const RWSockAddrBase & | addr, |
const RWSecureSocketContext & | context | ||
) |
Connects self to the address using context.
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.
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.
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |