Yate
|
A client to server stream. More...
#include <yatejabber.h>
Public Member Functions | |
JBClientStream (JBEngine *engine, Socket *socket, bool ssl=false) | |
JBClientStream (JBEngine *engine, const JabberID &jid, const String &account, const NamedList ¶ms, const char *name=0, const char *serverHost=0) | |
const String & | account () const |
GenObject * | userData () |
void | userData (GenObject *data) |
virtual JBClientStream * | clientStream () |
void | bind (const String &resource, const char *id, XMPPError::Type error=XMPPError::NoError) |
bool | requestRegister (bool data, bool set=true, const String &newPass=String::empty()) |
Protected Member Functions | |
virtual bool | processRunning (XmlElement *xml, const JabberID &from, const JabberID &to) |
virtual bool | processStart (const XmlElement *xml, const JabberID &from, const JabberID &to) |
virtual bool | processAuth (XmlElement *xml, const JabberID &from, const JabberID &to) |
virtual bool | processRegister (XmlElement *xml, const JabberID &from, const JabberID &to) |
virtual void | destroyed () |
bool | startAuth () |
bool | bind () |
Friends | |
class | JBStream |
A client to server stream.
This class holds a client to server stream
JBClientStream | ( | JBEngine * | engine, |
Socket * | socket, | ||
bool | ssl = false |
||
) |
Constructor. Build an incoming stream from a socket
engine | Engine owning this stream |
socket | The socket |
ssl | True if the socket is already using SSL/TLS |
JBClientStream | ( | JBEngine * | engine, |
const JabberID & | jid, | ||
const String & | account, | ||
const NamedList & | params, | ||
const char * | name = 0 , |
||
const char * | serverHost = 0 |
||
) |
void bind | ( | const String & | resource, |
const char * | id, | ||
XMPPError::Type | error = XMPPError::NoError |
||
) |
Bind a resource to an incoming stream. This method should be called after processing a Bind event This method is thread safe
resource | Resource to bind. Empty on error |
id | Received bind request id |
error | Failure reason. Ignored on success |
bool bind | ( | ) | [protected] |
Start resource binding on outgoing stream
virtual JBClientStream* clientStream | ( | ) | [inline, virtual] |
virtual bool processAuth | ( | XmlElement * | xml, |
const JabberID & | from, | ||
const JabberID & | to | ||
) | [protected, virtual] |
Process elements in Auth state
xml | Received element (will be consumed) |
from | Already parsed source JID |
to | Already parsed destination JID |
Reimplemented from JBStream.
virtual bool processRegister | ( | XmlElement * | xml, |
const JabberID & | from, | ||
const JabberID & | to | ||
) | [protected, virtual] |
Process elements in Register state
xml | Received element (will be consumed) |
from | Already parsed source JID |
to | Already parsed destination JID |
Reimplemented from JBStream.
virtual bool processRunning | ( | XmlElement * | xml, |
const JabberID & | from, | ||
const JabberID & | to | ||
) | [protected, virtual] |
Process elements in Running state
xml | Received element (will be consumed) |
from | Already parsed source JID |
to | Already parsed destination JID |
Reimplemented from JBStream.
virtual bool processStart | ( | const XmlElement * | xml, |
const JabberID & | from, | ||
const JabberID & | to | ||
) | [protected, virtual] |
Process stream start elements while waiting for them
xml | Received xml element |
from | The 'from' attribute |
to | The 'to' attribute |
Reimplemented from JBStream.
bool requestRegister | ( | bool | data, |
bool | set = true , |
||
const String & | newPass = String::empty() |
||
) |
Request account register or change on outgoing stream. This method is thread safe
data | True to request registration/change, false to request info |
set | True to request new user registration, false to remove account from server |
newPass | New password when requesting account setup on an already authenticated stream |
bool startAuth | ( | ) | [protected] |
Start outgoing stream authentication
Set stream's user data. Transfer data ownership to the stream This method is thread safe
data | Data to set |
References TelEngine::destruct().