Home · All Classes · All Namespaces · Modules · Functions · Files |
A class representing a Telepathy stream tube. More...
#include <TelepathyQt4/StreamTubeChannel>
Inherits Tp::TubeChannel.
Inherited by Tp::IncomingStreamTubeChannel, and Tp::OutgoingStreamTubeChannel.
A class representing a Telepathy stream tube.
It provides a transport for reliable and ordered data transfer, similar to SOCK_STREAM sockets.
This class provides high level methods for managing both incoming and outgoing tubes - however, you probably want to use one of its subclasses, #OutgoingStreamTubeChannel or #IncomingStreamTubeChannel, which both provide higher level methods for accepting or offering tubes.
For more details, please refer to Telepathy specification.
Tp::StreamTubeChannel::~StreamTubeChannel | ( | ) | [virtual] |
Class destructor.
Tp::StreamTubeChannel::StreamTubeChannel | ( | const ConnectionPtr & | connection, |
const QString & | objectPath, | ||
const QVariantMap & | immutableProperties, | ||
const Feature & | coreFeature = StreamTubeChannel::FeatureStreamTube |
||
) | [protected] |
Construct a new StreamTubeChannel object.
connection | Connection owning this channel, and specifying the service. |
objectPath | The object path of this channel. |
immutableProperties | The immutable properties of this channel. |
StreamTubeChannelPtr Tp::StreamTubeChannel::create | ( | const ConnectionPtr & | connection, |
const QString & | objectPath, | ||
const QVariantMap & | immutableProperties | ||
) | [static] |
Create a new StreamTubeChannel channel.
connection | Connection owning this channel, and specifying the service. |
objectPath | The object path of this channel. |
immutableProperties | The immutable properties of this channel. |
Reimplemented from Tp::TubeChannel.
Reimplemented in Tp::IncomingStreamTubeChannel, and Tp::OutgoingStreamTubeChannel.
QString Tp::StreamTubeChannel::service | ( | ) | const |
Returns the service name which will be used over the tube. This should be a well-known TCP service name, for instance "rsync" or "daap".
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
bool Tp::StreamTubeChannel::supportsIPv4SocketsOnLocalhost | ( | ) | const |
Checks if this tube is capable to accept or offer an IPv4 socket accepting all incoming connections coming from localhost. When this capability is available, the tube can be accepted or offered without any restriction on the access control on the other end.
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
true
.bool Tp::StreamTubeChannel::supportsIPv4SocketsWithSpecifiedAddress | ( | ) | const |
In case of an incoming tube, checks if this tube is capable to accept or offer an IPv4 socket accepting all incoming connections coming from a specific address only. When this capability is available, the tube can be accepted specifying an IPv4 address. Every connection coming from any other address than the specified one will be rejected.
In case of an outgoing tube, checks if this tube is capable of mapping connections to the socket's source address. If this is the case, to keep track of incoming connections you should enable StreamTubeChannel::FeatureConnectionMonitoring (possibly before opening the tube itself), and call either #OutgoingStreamTubeChannel::contactsForConnections or #OutgoingStreamTubeChannel::connectionsForSourceAddresses.
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
bool Tp::StreamTubeChannel::supportsIPv6SocketsOnLocalhost | ( | ) | const |
Checks if this tube is capable to accept or offer an IPv6 socket accepting all incoming connections coming from localhost. When this capability is available, the tube can be accepted or offered without any restriction on the access control on the other end.
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
bool Tp::StreamTubeChannel::supportsIPv6SocketsWithSpecifiedAddress | ( | ) | const |
In case of an incoming tube, checks if this tube is capable to accept or offer an IPv6 socket accepting all incoming connections coming from a specific address only. When this capability is available, the tube can be accepted specifying an IPv6 address. Every connection coming from any other address than the specified one will be rejected.
In case of an outgoing tube, checks if this tube is capable of mapping connections to the socket's source address. If this is the case, to keep track of incoming connections you should enable StreamTubeChannel::FeatureConnectionMonitoring (possibly before opening the tube itself), and call either #OutgoingStreamTubeChannel::contactsForConnections or #OutgoingStreamTubeChannel::connectionsForSourceAddresses.
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
bool Tp::StreamTubeChannel::supportsUnixSocketsOnLocalhost | ( | ) | const |
Checks if this tube is capable to accept or offer an Unix socket accepting all incoming connections coming from localhost. When this capability is available, the tube can be accepted or offered without any restriction on the access control on the other end.
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
bool Tp::StreamTubeChannel::supportsUnixSocketsWithCredentials | ( | ) | const |
Checks if this tube is capable to accept or offer an Unix socket which will require credentials upon connection.
When this capability is available and enabled, the connecting process must send a byte when it first connects, which is not considered to be part of the data stream. If the operating system uses sendmsg() with SCM_CREDS or SCM_CREDENTIALS to pass credentials over sockets, the connecting process must do so if possible; if not, it must still send the byte.
The listening process will disconnect the connection unless it can determine by OS-specific means that the connecting process has the same user ID as the listening process.
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
bool Tp::StreamTubeChannel::supportsAbstractUnixSocketsOnLocalhost | ( | ) | const |
Checks if this tube is capable to accept or offer an abstract Unix socket accepting all incoming connections coming from localhost.
When this capability is available, the tube can be accepted or offered without any restriction on the access control on the other end.
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
bool Tp::StreamTubeChannel::supportsAbstractUnixSocketsWithCredentials | ( | ) | const |
Checks if this tube is capable to accept or offer an abstract Unix socket which will require credentials upon connection.
When this capability is available and enabled, the connecting process must send a byte when it first connects, which is not considered to be part of the data stream. If the operating system uses sendmsg() with SCM_CREDS or SCM_CREDENTIALS to pass credentials over sockets, the connecting process must do so if possible; if not, it must still send the byte.
The listening process will disconnect the connection unless it can determine by OS-specific means that the connecting process has the same user ID as the listening process.
This method requires StreamTubeChannel::FeatureStreamTube to be enabled.
UIntList Tp::StreamTubeChannel::connections | ( | ) | const |
This function returns all the known active connections since FeatureConnectionMonitoring has been enabled. For this method to return all known connections, you need to make FeatureConnectionMonitoring ready before accepting or offering the tube.
SocketAddressType Tp::StreamTubeChannel::addressType | ( | ) | const |
Return the type of socket this StreamTube is using.
QPair< QHostAddress, quint16 > Tp::StreamTubeChannel::ipAddress | ( | ) | const |
Return the IP address/port combination used by this StreamTube as a QHostAddress.
This method will return a meaningful value only if the socket is an IP socket, hence when addressType returns either SocketAddressTypeIPv4 or SocketAddressTypeIPv6.
Reimplemented in Tp::IncomingStreamTubeChannel.
QString Tp::StreamTubeChannel::localAddress | ( | ) | const |
Return the local address used by this StreamTube as a QString.
This method will return a meaningful value only if the socket is local, hence when addressType returns either SocketAddressTypeUnix or SocketAddressTypeAbstractUnix.
Reimplemented in Tp::IncomingStreamTubeChannel.
void Tp::StreamTubeChannel::newConnection | ( | uint | connectionId | ) | [signal] |
void Tp::StreamTubeChannel::connectionClosed | ( | uint | connectionId, |
const QString & | error, | ||
const QString & | message | ||
) | [signal] |
Emitted when a connection has been closed.
connectionId | The unique ID associated with this connection. |
error | The error occurred |
message | A debug message |
void Tp::StreamTubeChannel::setBaseTubeType | ( | uint | type | ) | [protected] |
void Tp::StreamTubeChannel::setAddressType | ( | SocketAddressType | type | ) | [protected] |
void Tp::StreamTubeChannel::setConnections | ( | UIntList | connections | ) | [protected] |
void Tp::StreamTubeChannel::setIpAddress | ( | const QPair< QHostAddress, quint16 > & | address | ) | [protected] |
void Tp::StreamTubeChannel::setLocalAddress | ( | const QString & | address | ) | [protected] |
const Feature Tp::StreamTubeChannel::FeatureStreamTube [static] |
Feature representing the core that needs to become ready to make the StreamTubeChannel object usable.
Note that this feature must be enabled in order to use most StreamTubeChannel methods. See specific methods documentation for more details.
const Feature Tp::StreamTubeChannel::FeatureConnectionMonitoring [static] |
Feature used in order to monitor connections to this tube.
newConnection will be emitted upon a new connection connectionClosed will be emitted when an existing connection gets closed
Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation | Telepathy-Qt4 0.7.1 |