SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWBufferedRecvPortal Class Reference

Provides buffering of recv() calls only, possibly improving performance by limiting calls to the underlying RWPortal. More...

#include <rw/network/RWBufferedRecvPortal.h>

Inheritance diagram for RWBufferedRecvPortal:
RWPortal

Public Member Functions

 RWBufferedRecvPortal (void)
 
 RWBufferedRecvPortal (const RWPortal &portal, size_t bufferSize)
 
- 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
 
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

- Protected Member Functions inherited from RWPortal
 RWPortal (RWPortalImp *impl)
 
const RWPortalImpimplementation () const
 
RWPortalImpimplementation ()
 

Detailed Description

RWBufferedRecvPortal inherits from RWPortal to provide buffering of recv() calls. When calling recv() on the underlying RWPortal is expensive, RWBufferedRecvPortal may substantially increase efficiency by limiting the number of calls to the underlying RWPortal.

Note
When buffering receive data, all requests for data must be made through the RWBufferedRecvPortal object; do not make calls directly to the underlying RWPortal. Doing so may lose data that is currently buffered.
Example
portal = RWBufferedRecvPortal(portal, 1024);

Constructor & Destructor Documentation

RWBufferedRecvPortal::RWBufferedRecvPortal ( void  )

Constructs an invalid RWBufferedRecvPortal. Attempts to send or receive on the portal throw an RWNetNoChannelError exception.

To use an instance created with this constructor, you must assign to it from a valid RWBufferedRecvPortal instance.

RWBufferedRecvPortal::RWBufferedRecvPortal ( const RWPortal portal,
size_t  bufferSize 
)

Constructs a buffered portal on an existing portal. bufferSize is the requested size for the underlying buffer.

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