xrootd
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
XrdSsiStream Class Reference

#include <XrdSsiStream.hh>

Inheritance diagram for XrdSsiStream:
Inheritance graph
[legend]

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

◆ StreamType

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::XrdSsiStream ( StreamType  stype)
inline

◆ ~XrdSsiStream()

virtual XrdSsiStream::~XrdSsiStream ( )
inlinevirtual

Member Function Documentation

◆ GetBuff()

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

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

Parameters
eRefThe object to receive any error description.
dleninput: the optimal amount of data wanted (this is a hint) output: the actual amount of data returned in the buffer.
lastinput: 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().

◆ SetBuff() [1/2]

virtual bool XrdSsiStream::SetBuff ( XrdSsiErrInfo eRef,
char *  buff,
int  blen 
)
inlinevirtual

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

Parameters
eRefreference 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.
buffpointer to the buffer to receive the data. The buffer must remain valid until ProcessResponse() is called.
blenthe 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().

◆ SetBuff() [2/2]

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

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

Parameters
eRefThe object to receive any error description.
buffpointer to the buffer to receive the data. request object is notified that the operation completed.
blenthe length of the buffer (i.e. maximum that can be returned).
lastinput: 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().

◆ Type()

StreamType XrdSsiStream::Type ( )
inline

Get the stream type descriptor.

Returns
The stream type, isActive or isPassive.

References SType.

Member Data Documentation

◆ SType

const StreamType XrdSsiStream::SType
protected

Referenced by Type().


The documentation for this class was generated from the following file: