#include <bytestream.h>
Inherited by InBandBytestream, and SOCKS5Bytestream.
Inheritance diagram for Bytestream:

Public Types | |
| enum | StreamType { S5B, IBB } |
Public Member Functions | |
| Bytestream (StreamType type, LogSink &logInstance, const JID &initiator, const JID &target, const std::string &sid) | |
| virtual | ~Bytestream () |
| bool | isOpen () const |
| virtual bool | connect ()=0 |
| virtual void | close ()=0 |
| virtual bool | send (const std::string &data)=0 |
| virtual ConnectionError | recv (int timeout=-1)=0 |
| const std::string & | sid () const |
| StreamType | type () const |
| const JID & | target () const |
| const JID & | initiator () const |
| void | registerBytestreamDataHandler (BytestreamDataHandler *bdh) |
| void | removeBytestreamDataHandler () |
Protected Attributes | |
| 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 |
Used as a base class for InBand Bytestreams as well as SOCKS5 Bytestreams. You should not need to use this class directly.
Definition at line 36 of file bytestream.h.
|
|
Available stream types.
Definition at line 42 of file bytestream.h. |
|
||||||||||||||||||||||||
|
Creates a new Bytestream.
Definition at line 56 of file bytestream.h. |
|
|
Virtual destructor. Definition at line 65 of file bytestream.h. |
|
|
Closes the bytestream. Implemented in InBandBytestream, and SOCKS5Bytestream. |
|
|
This function starts the connection process.
Implemented in InBandBytestream, and SOCKS5Bytestream. |
|
|
Returns the initiating entity's JID. If this bytestream is remote-initiated, this is the remote entity's JID. If it is local-initiated, this is the local JID.
Definition at line 134 of file bytestream.h. |
|
|
Returns whether the bytestream is open, that is, accepted by both parties and ready to send/receive data.
Definition at line 72 of file bytestream.h. |
|
|
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.
Implemented in InBandBytestream, and SOCKS5Bytestream. |
|
|
Use this function to register an object that will receive any notifications from the Bytestream instance. Only one BytestreamDataHandler can be registered at any one time.
Definition at line 142 of file bytestream.h. |
|
|
Removes the registered BytestreamDataHandler. Definition at line 148 of file bytestream.h. |
|
|
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.
Implemented in InBandBytestream, and SOCKS5Bytestream. |
|
|
Lets you retrieve the stream's ID.
Definition at line 114 of file bytestream.h. |
|
|
Returns the target entity's JID. If this bytestream is remote-initiated, this is the local JID. If it is local-initiated, this is the remote entity's JID.
Definition at line 127 of file bytestream.h. |
|
|
Returns the stream's type.
Definition at line 120 of file bytestream.h. |
|
|
A handler for incoming data and open/close events. Definition at line 153 of file bytestream.h. |
|
|
The initiator's JID. Definition at line 159 of file bytestream.h. |
|
|
A LogSink instance to use for logging. Definition at line 156 of file bytestream.h. |
|
|
Indicates whether or not the stream is open. Definition at line 171 of file bytestream.h. |
|
|
The stream ID. Definition at line 168 of file bytestream.h. |
|
|
The target's JID. Definition at line 162 of file bytestream.h. |
|
|
The stream type. Definition at line 165 of file bytestream.h. |
1.4.1