SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWPortalImp Class Referenceabstract

Abstract base class from which to create specialized portal types. More...

#include <rw/network/RWPortalImp.h>

Inherited by RWBufferedPortalImp, RWHttpPortalImp, RWNoPortalImp, RWSecureSocketPortalImp, RWSocketPortalImp, and RWTimedPortalImp.

Public Member Functions

 RWPortalImp ()
 
virtual ~RWPortalImp ()
 
virtual RWNetBuf recv ()=0
 
virtual int recv (char *buf, int len, RWNetBuf::State *state)=0
 
virtual RWNetBuf recv (unsigned long timeout)
 
virtual int recv (char *buf, int len, RWNetBuf::State *state, unsigned long timeout)
 
virtual int send (const char *buf, int len)=0
 
virtual int send (const char *buf, int len, unsigned long timeout)
 

Detailed Description

RWPortalImp is an abstract base class from which to create specialized portal types. This class is the implementation class for RWPortal, and objects deriving from it should not be accessed directly, but rather by the interface RWPortal.

Classes derived from RWPortalImp implement the operations defined by the RWPortalImp interface.

Constructor & Destructor Documentation

RWPortalImp::RWPortalImp ( )
inline

Default constructor. Creates an empty object.

virtual RWPortalImp::~RWPortalImp ( )
virtual

Destroys this portal implementation.

Member Function Documentation

virtual RWNetBuf RWPortalImp::recv ( )
pure virtual

Receives all available data on the underlying communications channel. Derived classes must provide a definition for this method. This function returns a RWNetBuf that contains all data available on the communications channel at the time of the call. This function may throw an exception to indicate failure.

virtual int RWPortalImp::recv ( char *  buf,
int  len,
RWNetBuf::State state 
)
pure virtual

Receives data on the underlying communications channel. Derived classes must provide a definition for this method.

The buf parameter is a pointer to an array of characters to fill with data from the communications channel.This parameter may be NULL if the value of the len parameter is less than or equal to 0. The len parameter is the number of characters to read from the communications channel. The state parameter is a pointer to a RWNetBuf::State object or NULL. If this parameter is non-NULL, it should be set to the RWNetBuf::State enumeration that most appropriately describes the state of the underlying communications channel.

This function returns the number of characters read from the communications channel. The result may be less than the value of len. This function should return a negative value or throw an exception to indicate failure.

virtual RWNetBuf RWPortalImp::recv ( unsigned long  timeout)
virtual

Receives all available data on the underlying communications channel under the timeout specified. If the recv() operation times out, a derived class should throw an exception or return a value that indicates failure. The default implementation of this method throws a RWNetTimeoutNotImplementedError exception.

The timeout parameter is the maximum number of milliseconds that the recv() operation is allowed to take.

This function returns a RWNetBuf that contains all data available on the communications channel at the time of the call. This function should throw an exception to indicate failure.

virtual int RWPortalImp::recv ( char *  buf,
int  len,
RWNetBuf::State state,
unsigned long  timeout 
)
virtual

Receives data on the underlying communications channel under the timeout specified. If the recv() operation times out, the derived class should throw an exception or return a value that indicates failure. The default implementation of this method throws a RWNetTimeoutNotImplementedError exception.

The buf parameter is a pointer to an array of characters to fill with data from the communications channel.This parameter may be NULL if the value of the len parameter is less than or equal to 0. The len parameter is the number of characters to read from the communications channel. The timeout parameter is the maximum number of milliseconds that the recv() operation is allowed to take.

This function returns the number of characters read from the communications channel. The result may be less than the value of len. This function should return a negative value or throw an exception to indicate failure.

virtual int RWPortalImp::send ( const char *  buf,
int  len 
)
pure virtual

Sends the data specified over the underlying communications channel. Derived classes must provide a definition for this method.

The buf parameter is a pointer to an array of characters to write to the communications channel. This parameter may be NULL if the value of the len parameter is less than or equal to 0. The len parameter is the number of characters to read from the communications channel.

This function returns the number of characters written to the communications channel. The result may be less than the value of len. This function should return a negative value or throw an exception to indicate failure.

virtual int RWPortalImp::send ( const char *  buf,
int  len,
unsigned long  timeout 
)
virtual

Sends the data specified over the underlying communications channel under the timeout specified. If the send() operation times out, the derived class should throw an exception or return a value that indicates failure. The default implementation of this method throws a RWNetTimeoutNotImplementedError exception.

The buf parameter is a pointer to an array of characters to write to the communications channel. This parameter may be NULL if the value of the len parameter is less than or equal to 0. The len parameter is the number of characters to read from the communications channel. The timeout parameter is the maximum number of milliseconds that the send() operation is allowed to take.

This function returns the number of characters written to the communications channel. The result may be less than the value of len. This function should return a negative value or throw an exception to indicate failure.

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