InBandBytestream Class Reference

An implementation of a single In-Band Bytestream (JEP-0047). More...

#include <inbandbytestream.h>

Inherits MessageFilter.

Inheritance diagram for InBandBytestream:

Inheritance graph
[legend]
Collaboration diagram for InBandBytestream:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~InBandBytestream ()
bool isOpen () const
bool sendBlock (const std::string &data)
const std::string & sid () const
int blockSize () const
void registerInBandBytestreamDataHandler (InBandBytestreamDataHandler *ibbdh)
void removeInBandBytestreamDataHandler ()
virtual void decorate (Tag *tag)
virtual void filter (Stanza *stanza)

Friends

class InBandBytestreamManager

Detailed Description

An implementation of a single In-Band Bytestream (JEP-0047).

One instance of this class handles one byte stream. You can attach as many InBandBytestream objects to a MessageSession as you like.

See InBandBytestreamManager for a detailed description on how to implement In-Band Bytestreams.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.8

Definition at line 39 of file inbandbytestream.h.


Constructor & Destructor Documentation

~InBandBytestream (  )  [virtual]

Virtual destructor.

Definition at line 33 of file inbandbytestream.cpp.


Member Function Documentation

bool isOpen (  )  const [inline]

Returns whether the bytestream is open, that is, accepted by both parties.

Returns:
Whether the bytestream is open or not.

Definition at line 53 of file inbandbytestream.h.

bool sendBlock ( const std::string &  data  ) 

Use this function to send a chunk of data over an open byte stream. The negotiated block size is enforced. If the block is larger, nothing is sent and false is returned. If the stream is not open or has been closed again (by the remote entity or locally), nothing is sent and false is returned. This function does the necessary base64 encoding for you.

Parameters:
data The block of data to send.
Returns:
True if the data has been sent (no guarantee of receipt), false in case of an error.

Definition at line 93 of file inbandbytestream.cpp.

const std::string& sid (  )  const [inline]

Lets you retrieve the stream's ID.

Returns:
The stream's ID.

Definition at line 71 of file inbandbytestream.h.

Referenced by InBandBytestreamManager::acceptInBandBytestream(), InBandBytestreamManager::dispose(), InBandBytestream::filter(), and InBandBytestreamManager::rejectInBandBytestream().

int blockSize (  )  const [inline]

Lets you retrieve this bytestream's block-size.

Returns:
The bytestream's block-size.

Definition at line 77 of file inbandbytestream.h.

void registerInBandBytestreamDataHandler ( InBandBytestreamDataHandler ibbdh  ) 

Use this function to register an object that will receive any notifications from the InBandBytestream instance. Only one InBandBytestreamDataHandler can be registered at any one time.

Parameters:
ibbdh The InBandBytestreamDataHandler-derived object to receive notifications.

Definition at line 152 of file inbandbytestream.cpp.

void removeInBandBytestreamDataHandler (  ) 

Removes the registered InBandBytestreamDataHandler.

Definition at line 157 of file inbandbytestream.cpp.

void decorate ( Tag tag  )  [virtual]

This function receives a message right before it is sent out (there may be other filters which get to see the message after this filter, though).

Parameters:
tag The tag to decorate. It contains the message to be sent.

Implements MessageFilter.

Definition at line 42 of file inbandbytestream.cpp.

void filter ( Stanza stanza  )  [virtual]

This function receives a message stanza right after it was received (there may be other filters which got to see the stanza before this filter, though).

Parameters:
stanza The complete message stanza.

Implements MessageFilter.

Definition at line 46 of file inbandbytestream.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 1 14:20:24 2007 for gloox by  doxygen 1.5.1