SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (const RWPortal &portal, size_t bufferSize)
 
 RWBufferedRecvPortal (void)
 
- 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

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

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);
An access point to a reliable byte stream communication channel.
Definition RWPortal.h:68
Socket implementation of a portal.
Definition RWSocketPortal.h:34

Constructor & Destructor Documentation

◆ RWBufferedRecvPortal() [1/2]

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

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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.