Offering a TCP StreamTube finally works as it is supposed to do! So, if you want to start a streamtube, you just have to create an OfferTcpStreamTubeJob using your favorite method offered by TelepathyBridge:
KJob* offerTcpStreamTube(const Nepomuk::PersonContact& contact,
const QVariantMap& parameters = QVariantMap());
KJob* offerTcpStreamTube(const Nepomuk::PersonContact& contact,
const QHostAddress& hostAddress,
quint16 port = 0,
const QVariantMap& parameters = QVariantMap());
KJob* offerTcpStreamTube(const Nepomuk::PersonContact& contact,
QTcpServer* server,
const QVariantMap& parameters = QVariantMap());
KJob* offerTcpStreamTube(const Nepomuk::Person& metacontact,
const QVariantMap& parameters = QVariantMap());
KJob* offerTcpStreamTube(const Nepomuk::Person& metacontact,
const QHostAddress& hostAddress,
quint16 port = 0,
const QVariantMap& parameters = QVariantMap());
KJob* offerTcpStreamTube(const Nepomuk::Person& metacontact,
QTcpServer* server,
const QVariantMap& parameters = QVariantMap());
…for example…
Nepomuk::PersonContact targetContact = ...;
server = new QTcpServer;
server->listen();
KJob* job = TelepathyBridge::instance()->offerTcpStreamTube(targetContact, server);
…then just start the job…
connect( job, SIGNAL(result(KJob*)), this, SLOT (handleResult(KJob*))); job->start();
…and you should be able to forget that you are using telepathy and you can control everything using your QTcpServer!
If you feel brave enough to test it, you can find the code on gitorious
And now time for some more beautiful screenshots (Yeah, they are not really useful, but I wanted to show something š )
More StreamTube Parameters
KNotify and StreamTubes
EDIT: I really hate you, WordPress! Iām sorry for escaped characters…