gloox
1.0
|
#include <inbandbytestream.h>
Public Member Functions | |
virtual | ~InBandBytestream () |
int | blockSize () const |
void | setBlockSize (int blockSize) |
virtual ConnectionError | recv (int timeout=-1) |
bool | send (const std::string &data) |
virtual bool | connect () |
virtual void | close () |
virtual bool | handleIq (const IQ &iq) |
virtual void | handleIqID (const IQ &iq, int context) |
virtual void | handleMessage (const Message &msg, MessageSession *session=0) |
Public Member Functions inherited from Bytestream | |
Bytestream (StreamType type, LogSink &logInstance, const JID &initiator, const JID &target, const std::string &sid) | |
virtual | ~Bytestream () |
bool | isOpen () const |
const std::string & | sid () const |
StreamType | type () const |
const JID & | target () const |
const JID & | initiator () const |
void | registerBytestreamDataHandler (BytestreamDataHandler *bdh) |
void | removeBytestreamDataHandler () |
Public Member Functions inherited from IqHandler | |
virtual | ~IqHandler () |
Public Member Functions inherited from MessageHandler | |
virtual | ~MessageHandler () |
Additional Inherited Members | |
Public Types inherited from Bytestream | |
enum | StreamType { S5B, IBB } |
Protected Attributes inherited from Bytestream | |
BytestreamDataHandler * | m_handler |
const LogSink & | m_logInstance |
const JID | m_initiator |
const JID | m_target |
StreamType | m_type |
std::string | m_sid |
bool | m_open |
An implementation of a single In-Band Bytestream (XEP-0047).
One instance of this class handles a single byte stream.
See SIProfileFT for a detailed description on how to implement file transfer.
Definition at line 43 of file inbandbytestream.h.
|
virtual |
Virtual destructor.
Definition at line 114 of file inbandbytestream.cpp.
|
inline |
Lets you retrieve this bytestream's block-size.
Definition at line 58 of file inbandbytestream.h.
|
virtual |
|
virtual |
This function starts the connection process.
Implements Bytestream.
Definition at line 127 of file inbandbytestream.cpp.
|
virtual |
Reimplement this function if you want to be notified about incoming IQs.
iq | The complete IQ stanza. |
Implements IqHandler.
Definition at line 161 of file inbandbytestream.cpp.
|
virtual |
Reimplement this function if you want to be notified about incoming IQs with a specific value of the id
attribute. You have to enable tracking of those IDs using Client::trackID(). This is usually useful for IDs that generate a positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.
iq | The complete IQ stanza. |
context | A value to restore context, stored with ClientBase::trackID(). |
Implements IqHandler.
Definition at line 142 of file inbandbytestream.cpp.
|
virtual |
Reimplement this function if you want to be notified about incoming messages.
msg | The complete Message. |
session | If this MessageHandler is used with a MessageSession, this parameter holds a pointer to that MessageSession. |
Implements MessageHandler.
Definition at line 206 of file inbandbytestream.cpp.
|
inlinevirtual |
Call this function repeatedly to receive data. You should even do this if you use the bytestream to merely send data. May be a NOOP, depending on the actual stream type.
timeout | The timeout to use for select in microseconds. Default of -1 means blocking. |
Implements Bytestream.
Definition at line 68 of file inbandbytestream.h.
|
virtual |
Use this function to send a chunk of data over an open bytestream. 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 any base64 encoding for you, if necessary.
data | The block of data to send. |
Implements Bytestream.
Definition at line 247 of file inbandbytestream.cpp.
|
inline |
Sets the stream's block-size. Default: 4096
blockSize | The new block size. |
Definition at line 65 of file inbandbytestream.h.