[Telepathy] API Draft for high level tubes in tp-qt4

Dario Freddi drf54321 at gmail.com
Tue Apr 20 09:20:44 PDT 2010


Thanks Andre and Olli for reviewing,

On Monday 19 April 2010 19:57:40 you wrote:
> On 18/04/10 10:09, Dario Freddi wrote:
> > Hello all,
> > 
> > as discussed with Andre on IRC, I drafted a small API for managing Tubes
> > in tp-qt4 (see attachment). There's really nothing fancy here: it's a
> > quite straightforward mapping of the spec to a Qt-like API, and it's
> > mostly what tp- glib does as well.
> > 
> > Still, I'd find it cool to provide a function returning a QAbstractSocket
> > for StreamTubes and a QDBusConnection (or a DBusProxy) for DBusTubes to
> > make it extremely easy to use the opened tube. I'd like some feedback on
> > that though, since I don't know how much it would be feasible.
> 
> I like the overall idea, but I would change some things as:
> - ST and DT should be implemented similarly to FileTransfer channels
> where we have Incoming/Outgoing channels depending on the requested
> property of the channel.

Cool idea - I added an Incoming/OutcomingStreamTube class (I will just port 
the design over to DBusTube once it is settled).

I stumbled upon some things which are not really clear to me, though. 
FileTransfer has an almost identical API (now I see why you pointed me to it); 
however, tp-qt4 always assumes to use an IPv4 socket with localhostcontrol.

I suppose this is not possible with StreamTube, where one should actually 
export an existing socket. To avoid showing the user all of the "offer" 
parameters when creating the channel, I thought it would be cool to pass over 
a QIODevice.

But what about the accept() method for IncomingStreamTube? Would it be ok to 
force the same parameters FileTransfer does? I suppose I'm missing the part on 
how Telepathy handles all of this internally.

When this is settled, I'll resend the headers - this time I tried to stay as 
consistent as possible with FT channels.

> - For ST you probably want to return a QIODevice on accept, or a
> PendingIODevice (you name it) of some sort, so you can instantiate a Qt
> Socket object (QLocal/Tcp/UdpSocket) depending on the type of the socket.
> 
> You may want to check how FT is implemented in tp-qt4 and get some ideas
> from there.
> 
> BR
> Andre

-- 
-------------------

Dario Freddi
KDE Developer
GPG Key Signature: 511A9A3B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/telepathy/attachments/20100420/944986c7/attachment.pgp>


More information about the telepathy mailing list