XMPP::Stream Class Reference

#include <xmpp.h>

Inheritance diagram for XMPP::Stream:

PIndirectChannel PChannel PObject

Public Member Functions

 Stream (Transport *transport=0)
 ~Stream ()
virtual PBoolean OnOpen ()
PNotifierListOpenHandlers ()
virtual PBoolean Close ()
virtual void OnClose ()
PNotifierListCloseHandlers ()
virtual PBoolean Write (const void *buf, PINDEX len)
virtual PBoolean Write (const PString &data)
virtual PBoolean Write (const PXML &pdu)
virtual PXMLRead ()
virtual void Reset ()
PXMLStreamParserGetParser ()

Protected Attributes

PXMLStreamParserm_Parser
PNotifierList m_OpenHandlers
PNotifierList m_CloseHandlers

Detailed Description

This class represents a XMPP stream, i.e. a XML message exchange between XMPP entities


Constructor & Destructor Documentation

XMPP::Stream::Stream ( Transport transport = 0  ) 

XMPP::Stream::~Stream (  ) 


Member Function Documentation

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.

Returns:
PTrue if the channel is closed.

Reimplemented from PIndirectChannel.

PNotifierList& XMPP::Stream::CloseHandlers (  )  [inline]

PXMLStreamParser* XMPP::Stream::GetParser (  )  [inline]

virtual void XMPP::Stream::OnClose (  )  [inline, virtual]

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 PTrue.

Returns:
Returns PTrue if the protocol handshaking is successful.

Reimplemented from PIndirectChannel.

PNotifierList& XMPP::Stream::OpenHandlers (  )  [inline]

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 PXML pdu  )  [virtual]

virtual PBoolean XMPP::Stream::Write ( const PString data  )  [virtual]

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 PFalse to determine what caused the failure.

Returns:
PTrue if at least len bytes were written to the channel.

Reimplemented from PIndirectChannel.


Field Documentation

PNotifierList XMPP::Stream::m_CloseHandlers [protected]

PNotifierList XMPP::Stream::m_OpenHandlers [protected]

PXMLStreamParser* XMPP::Stream::m_Parser [protected]


The documentation for this class was generated from the following file:
Generated on Mon Feb 21 20:10:45 2011 for PTLib by  doxygen 1.4.7