#include <streambase.h>
Protected Member Functions |
void | stampTag (gloox::Tag *tag) |
Detailed Description
A class that abstracts a single client connection. Used by C2S.
- Author
- Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Definition at line 47 of file streambase.h.
Constructor & Destructor Documentation
Creates a new StreamBase object. It handles all the aspects of a single client connection (login, etc).
- Parameters
-
c2s | The parent C2S. |
cm | The local ConfigManager. |
connection | The (usually) TCP connection used for communication with the client. |
logInstance | The LogSink to use for logging. |
Definition at line 73 of file streambase.cpp.
Member Function Documentation
gloox::ConnectionBase* connection |
( |
| ) |
|
|
inline |
Returns the current transport connection.
- Returns
- The current transport connection.
Definition at line 120 of file streambase.h.
void disconnect |
( |
gloox::ConnectionError |
e, |
|
|
gloox::StreamError |
se = gloox::StreamErrorUndefined , |
|
|
const std::string & |
text = gloox::EmptyString |
|
) |
| |
Sends a stream error and disconnects the client connection.
- Parameters
-
e | The reason for the disconnect. |
se | The stream error to send. If this is StreamErrorUndefined , no stream error will be sent. |
text | An optional string describing the error. |
Definition at line 142 of file streambase.cpp.
void finishStreamFeature |
( |
StreamState |
state, |
|
|
gloox::ConnectionBase * |
conn = 0 |
|
) |
| |
Used by StreamFeature-derived classes, this function finishes processing of a given stream feature by adding (bitwise OR) a State to the current stream state, disabling the exclusive Handler (usually the StreamFeature that calls finishStreamfeature()), and optionally pluging a new connection on top of the current connection chain.
- Parameters
-
state | The StreamState to add. |
conn | An optional connection to use. |
Definition at line 237 of file streambase.cpp.
void handleIncomingTag |
( |
gloox::Tag * |
tag | ) |
|
Tags passed to this function should be addressed to the StreamBase instance and will be processed locally (i.e. they will not be sent to the remote client).
- Parameters
-
Definition at line 269 of file streambase.cpp.
void handleOutgoingTag |
( |
gloox::Tag * |
tag | ) |
|
Tags passed to this function should be addressed to the remote client and will be sent there (notwithstanding a set exclusive handler). They will not be otherwise processed locally.
- Parameters
-
Definition at line 287 of file streambase.cpp.
const std::string& id |
( |
| ) |
const |
|
inline |
Returns the client's internal unique ID.
- Returns
- The client's internal unique ID.
Definition at line 206 of file streambase.h.
const gloox::JID& jid |
( |
| ) |
const |
|
inline |
Returns the client's JID.
- Returns
- The client's JID.
Definition at line 132 of file streambase.h.
const gloox::LogSink& logInstance |
( |
| ) |
|
|
inline |
Returns the LogSink instance for this StreamBase and all related objects.
- Returns
- The LogSink instance used in the current StreamBase instance.
Definition at line 126 of file streambase.h.
const gloox::JID name |
( |
| ) |
const |
gloox::ConnectionError recv |
( |
int |
timeout = -1 | ) |
|
Use this periodically to receive data from the underlying client connection.
- Parameters
-
timeout | The timeout to use for select in microseconds. Default of -1 means blocking. |
- Returns
- The state of the connection.
Definition at line 134 of file streambase.cpp.
void routeTag |
( |
gloox::Tag * |
tag | ) |
|
Hands the tag over to the router.
- Parameters
-
Definition at line 458 of file streambase.cpp.
Starts processing incoming events. Blocks if the threading
parameter to the constructor is true.
- Note
- currently used only internally.
Definition at line 106 of file streambase.cpp.
void send |
( |
gloox::Tag * |
tag | ) |
|
Sends the given Tag to the remote end.
- Parameters
-
Definition at line 214 of file streambase.cpp.
void send |
( |
const std::string & |
xml | ) |
|
Sends the given XML string to the remote end.
- Parameters
-
Definition at line 228 of file streambase.cpp.
void send |
( |
const gloox::IQ & |
iq | ) |
|
Sends the given IQ to the remote end.
- Parameters
-
Definition at line 223 of file streambase.cpp.
Sets the supported stream features.
- Parameters
-
features | A list of supported stream features. |
Definition at line 78 of file streambase.h.
void setResource |
( |
const std::string & |
resource | ) |
|
|
inline |
Used by the authentication routines, this function sets the resource the remote client bound or that got assigned by the SM.
- Parameters
-
Definition at line 161 of file streambase.h.
void setServer |
( |
const std::string & |
server | ) |
|
|
inline |
Used by the authentication routines, this function sets the domain part of the remote client's authorized JID. This is used if the authorization ID supplied has a different server part than the stream greeting's 'to' attribute.
- Parameters
-
server | The domain/server part of the JID. |
Definition at line 141 of file streambase.h.
void setStrictXMPP |
( |
bool |
enable | ) |
|
|
inline |
Enables or disables aset of rules that enforce strict XMPP. Currently, only a version='1.0' stream attribute is required if this is enabled. Enabled by default.
- Parameters
-
enable | True to enable, false to disable strcit XMPP. |
- Since
- 0.3
Definition at line 172 of file streambase.h.
void setUsername |
( |
const std::string & |
username | ) |
|
|
inline |
Used by the authentication routines, this function sets the username the remote client authenticated as.
- Parameters
-
Definition at line 151 of file streambase.h.
void stampTag |
( |
gloox::Tag * |
tag | ) |
|
|
protected |
The documentation for this class was generated from the following files: