rwlogo
SourcePro C++ 13.0

SourcePro® C++ API Reference Guide

Product Documentation:

   SourcePro C++
Documentation Home

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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
  More...
 
RWNetBuf recvAtLeast (int n) const
 
int recvAtLeast (char *buf, int bufLen, int n, RWNetBuf::State *state=0) const
  More...
 
int send (const RWCString &s) const
 
int send (const char *buf, int buflen) const
  More...
 
int sendAtLeast (const char *buf, int bufLen, int n) const
 
void sendAtLeast (const char *buf, int bufLen) const
  More...
 
int sendAtLeast (const RWCString &s, int n) const
  More...
 
void sendAtLeast (const RWCString &s) const
  More...
 

Additional Inherited Members

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

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 © 2014 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.