SourcePro® 2023.1 |
SourcePro® API Reference Guide |
Socket implementation of a portal. More...
#include <rw/network/RWSocketPortal.h>
Public Member Functions | |
RWSocketPortal () | |
RWSocketPortal (const RWSockAddrBase &) | |
RWSocketPortal (const RWSocket &socket, WhoShouldClose=Portal) | |
void | connect (const RWSockAddrBase &address) |
RWSocket | 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 () |
RWSocketPortal is a socket implementation of a portal, implemented using the RWSocket class. State is not added to RWPortal. This means that you can assign an RWSocketPortal to an RWPortal without loss of data, except for the type.
The RWSocket representing the RWSocketPortal communication channel is normally closed when the last portal into the channel is destroyed. It is possible to prevent this by using a special constructor.
RWSocketPortal::RWSocketPortal | ( | ) |
Creates a socket portal. You need to establish a connection using connect() or the assignment operator before the portal can be used.
RWSocketPortal::RWSocketPortal | ( | const RWSockAddrBase & | ) |
Creates a socket portal connected to the address provided.
RWSocketPortal::RWSocketPortal | ( | const RWSocket & | socket, |
WhoShouldClose | = Portal |
||
) |
Creates a portal to the communications channel represented by socket. Using this constructor is the only way to create a socket that is not automatically closed when portals are no longer using it.
void RWSocketPortal::connect | ( | const RWSockAddrBase & | address | ) |
Connects this portal to the address provided.
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |