PTLib
Version 2.10.4
|
This class represents a XMPP stream, i.e. More...
#include <xmpp.h>
Public Member Functions | |
Stream (Transport *transport=0) | |
~Stream () | |
virtual PBoolean | OnOpen () |
This callback is executed when the Open() function is called with open channels. | |
PNotifierList & | OpenHandlers () |
virtual PBoolean | Close () |
Close the channel. | |
virtual void | OnClose () |
PNotifierList & | CloseHandlers () |
virtual PBoolean | Write (const void *buf, PINDEX len) |
Low level write to the channel. | |
virtual PBoolean | Write (const PString &data) |
virtual PBoolean | Write (const PXML &pdu) |
virtual PXML * | Read () |
Read a XMPP stanza from the stream. | |
virtual void | Reset () |
Reset the parser. | |
PXMLStreamParser * | GetParser () |
Protected Attributes | |
PXMLStreamParser * | m_Parser |
PNotifierList | m_OpenHandlers |
PNotifierList | m_CloseHandlers |
XMPP::Stream::Stream | ( | Transport * | transport = 0 | ) |
virtual PBoolean XMPP::Stream::Close | ( | ) | [virtual] |
Close the channel.
This will detach itself from the read and write channels and delete both of them if they are auto delete.
Reimplemented from PIndirectChannel.
PNotifierList& XMPP::Stream::CloseHandlers | ( | ) | [inline] |
References m_CloseHandlers.
PXMLStreamParser* XMPP::Stream::GetParser | ( | ) | [inline] |
References m_Parser.
virtual void XMPP::Stream::OnClose | ( | ) | [inline, virtual] |
References PNotifierList::Fire(), and m_CloseHandlers.
virtual PBoolean XMPP::Stream::OnOpen | ( | ) | [inline, virtual] |
This callback is executed when the Open() function is called with open channels.
It may be used by descendent channels to do any handshaking required by the protocol that channel embodies.
The default behaviour is to simply return true.
Reimplemented from PIndirectChannel.
References PNotifierList::Fire(), and m_OpenHandlers.
PNotifierList& XMPP::Stream::OpenHandlers | ( | ) | [inline] |
References m_OpenHandlers.
virtual PXML* XMPP::Stream::Read | ( | ) | [virtual] |
Read a XMPP stanza from the stream.
virtual void XMPP::Stream::Reset | ( | ) | [virtual] |
Reset the parser.
The will delete and re-instantiate the XML stream parser.
virtual PBoolean XMPP::Stream::Write | ( | const void * | buf, |
PINDEX | len | ||
) | [virtual] |
Low level write to the channel.
This function will block until the requested number of characters are written or the write timeout is reached. The GetLastWriteCount() function returns the actual number of bytes written.
This will use the writeChannel
pointer to actually do the write. If writeChannel
is null the this asserts.
The GetErrorCode() function should be consulted after Write() returns false to determine what caused the failure.
Reimplemented from PIndirectChannel.
virtual PBoolean XMPP::Stream::Write | ( | const PString & | data | ) | [virtual] |
virtual PBoolean XMPP::Stream::Write | ( | const PXML & | pdu | ) | [virtual] |
PNotifierList XMPP::Stream::m_CloseHandlers [protected] |
Referenced by CloseHandlers(), and OnClose().
PNotifierList XMPP::Stream::m_OpenHandlers [protected] |
Referenced by OnOpen(), and OpenHandlers().
PXMLStreamParser* XMPP::Stream::m_Parser [protected] |
Referenced by GetParser().