Home · All Classes · All Namespaces · Modules · Functions · Files |
The StreamTubeClient::TcpSourceAddressGenerator abstract interface allows using socket source address/port based access control for connecting to tubes accepted as TCP sockets. More...
#include <TelepathyQt/StreamTubeClient>
Public Member Functions | |
virtual QPair< QHostAddress, quint16 > | nextSourceAddress (const AccountPtr &account, const IncomingStreamTubeChannelPtr &tube)=0 |
Protected Member Functions | |
virtual | ~TcpSourceAddressGenerator () |
The StreamTubeClient::TcpSourceAddressGenerator abstract interface allows using socket source address/port based access control for connecting to tubes accepted as TCP sockets.
By default, every application on the local computer is allowed to connect to the socket created by the protocol backend as the local endpoint of the tube. This is not always desirable, as that includes even other users.
Note that since every TCP connection must have an unique source address, only one simultaneous connection can be made through each tube for which this type of access control has been used.
|
inlineprotectedvirtual |
Class destructor. Protected, because StreamTubeClient never deletes a TcpSourceAddressGenerator passed to it.
|
pure virtual |
Return the source address from which connections will be allowed to the given tube once it has been accepted.
Returning the pair (QHostAddress::Any, 0) (or alternatively (QHostAddress::AnyIPv4, 0) in Qt5) makes the protocol backend allow connections from any address on the local computer. This can be used on a tube-by-tube basis if for some tubes its known that multiple connections need to be made, so a single source address doesn't suffice.
The account and tube parameters can be inspected to make the decision; typically by looking at the tube's service type, parameters and/or initiator contact.
The general pattern for implementing this method is:
account | The account from which the tube originates. |
tube | The tube channel which is going to be accepted by the StreamTubeClient. |
Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation | Telepathy-Qt 0.9.7 |