XrdSsiStream Class Reference

#include <XrdSsiStream.hh>

Inheritance diagram for XrdSsiStream:
Inheritance graph
[legend]

List of all members.

Classes

class  Buffer

Public Types

enum  StreamType { isActive = 0, isPassive }

Public Member Functions

virtual BufferGetBuff (XrdSsiErrInfo &eRef, int &dlen, bool &last)
virtual bool SetBuff (XrdSsiErrInfo &eRef, char *buff, int blen)
virtual int SetBuff (XrdSsiErrInfo &eRef, char *buff, int blen, bool &last)
StreamType Type ()
 XrdSsiStream (StreamType stype)
virtual ~XrdSsiStream ()

Protected Attributes

const StreamType SType

Detailed Description

The XrdSsiStream class describes an object capable of providing data for a response in real time. A pointer to such an object may be used to set this response mode via XrdSsiResponder::SetResponse(). Two kinds of streams exist:

Active the stream supplies the buffer that contains the response data. The buffer is recycled via Buffer::Recycle() once the response data is sent. Active streams are supported only server-side. Passive the stream requires a buffer to be passed to it where response data will be placed. Only passive streams are created on the client-side. Passive streams can also work in asynchronous mode. However, async mode is never used server-side but may be requested client-side.

The type of stream must be declared at the time the stream is created. You must supply an implementation for the associated stream type.


Member Enumeration Documentation

Stream type descriptor:

isActive - Active stream that supplies it own buffers with data. GetBuff() & RetBuff() must be used.

isPassive - Passive stream that provides data via a supplied buffer. SetBuff() must be used.

Enumerator:
isActive 
isPassive 

Constructor & Destructor Documentation

XrdSsiStream::XrdSsiStream ( StreamType  stype  )  [inline]
virtual XrdSsiStream::~XrdSsiStream (  )  [inline, virtual]

Member Function Documentation

virtual Buffer* XrdSsiStream::GetBuff ( XrdSsiErrInfo eRef,
int &  dlen,
bool &  last 
) [inline, virtual]

Synchronously obtain data from an active stream (server-side only).

Parameters:
eRef The object to receive any error description.
dlen input: the optimal amount of data wanted (this is a hint) output: the actual amount of data returned in the buffer.
last input: should be set to false. output: if true it indicates that no more data remains to be returned either for this call or on the next call.
Returns:
=0 No more data remains or an error occurred: last = true: No more data remains. last = false: A fatal error occurred, eRef has the reason.
!0 Pointer to the Buffer object that contains a pointer to the the data (see below). The buffer must be returned to the stream using Buffer::Recycle(). The next member is usable.

References XrdSsiErrInfo::Set().

virtual int XrdSsiStream::SetBuff ( XrdSsiErrInfo eRef,
char *  buff,
int  blen,
bool &  last 
) [inline, virtual]

Synchronously obtain data from a passive stream (client- or server-side).

Parameters:
eRef The object to receive any error description.
buff pointer to the buffer to receive the data. request object is notified that the operation completed.
blen the length of the buffer (i.e. maximum that can be returned).
last input: should be set to false. output: if true it indicates that no more data remains to be returned either for this call or on the next call.
Returns:
>0 The number of bytes placed in buff.
=0 No more data remains and the stream becomes invalid.
<0 Fatal error occurred; eRef holds the reason.

Reimplemented in XrdSsiTaskReal.

References XrdSsiErrInfo::Set().

virtual bool XrdSsiStream::SetBuff ( XrdSsiErrInfo eRef,
char *  buff,
int  blen 
) [inline, virtual]

Asynchronously obtain data from a passive stream (client-side only).

Parameters:
eRef reference to where error information is to be placed for encountered before during the stream initiation. When data is ready for processing, the ProcessResponseData() callback is called on the request associated with this stream. Also see XrdSsiRequest::GetResponseData() helper method.
buff pointer to the buffer to receive the data. The buffer must remain valid until ProcessResponse() is called.
blen the length of the buffer (i.e. maximum that can be returned).
Returns:
true The stream has been successfully scheduled to return the data.
false The stream could not be scheduled; eRef holds the reason.

Reimplemented in XrdSsiTaskReal.

References XrdSsiErrInfo::Set().

StreamType XrdSsiStream::Type (  )  [inline]

Get the stream type descriptor.

Returns:
The stream type, isActive or isPassive.

References SType.


Member Data Documentation

const StreamType XrdSsiStream::SType [protected]

Referenced by Type().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 13 May 2020 for xrootd by  doxygen 1.6.1