SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWSocketPortal Class Reference

Socket implementation of a portal. More...

#include <rw/network/RWSocketPortal.h>

Inheritance diagram for RWSocketPortal:
RWPortal RWSocketPortalBase

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 ()
 
RWPortaloperator= (const RWPortal &x)
 
RWNetBuf recv () const
 
int recv (char *buf, int bufLen, RWNetBuf::State *state=0) const
 
int recvAtLeast (char *buf, int bufLen, int n, RWNetBuf::State *state=0) const
 
RWNetBuf recvAtLeast (int n) const
 
int send (const char *buf, int buflen) const
 
int send (const RWCString &s) const
 
void sendAtLeast (const char *buf, int bufLen) const
 
int sendAtLeast (const char *buf, int bufLen, int n) const
 
void sendAtLeast (const RWCString &s) const
 
int sendAtLeast (const RWCString &s, int n) const
 

Additional Inherited Members

- Public Types inherited from RWSocketPortalBase
enum  WhoShouldClose { Portal , Application }
 
- Protected Member Functions inherited from RWPortal
 RWPortal (RWPortalImp *impl)
 
RWPortalImpimplementation ()
 
const RWPortalImpimplementation () const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RWSocketPortal() [1/3]

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() [2/3]

RWSocketPortal::RWSocketPortal ( const RWSockAddrBase & )

Creates a socket portal connected to the address provided.

◆ RWSocketPortal() [3/3]

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.

Member Function Documentation

◆ connect()

void RWSocketPortal::connect ( const RWSockAddrBase & address)

Connects this portal to the address provided.

◆ getSocket()

RWSocket RWSocketPortal::getSocket ( ) const

Returns a copy of the underlying RWSocket object.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.