[Bug 29218] TpStreamTube - high level stream tube API

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 23 15:30:26 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=29218

--- Comment #20 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2010-09-23 06:30:23 PDT ---
(In reply to comment #12)
> We are supposed to pass the (ip, port) from where we are going to connect to
> Accept(). That means we should create the client socket before calling Accept
> which is not a big deal.
> But that raises another problem: this API doesn't let the accepter connect more
> than once to the tube.

Decisions a client needs to make include:

* Am I going to let telepathy-glib make the connection, or hand it over to
someone else?

Vinagre has been adapted to Tubes, so it makes sense for it to get a GIOStream
from Telepathy. A less well-adapted application might expect a GSocketAddress,
but it'll never integrate very well like that; I think we'll basically only see
this for a thin shim that invokes something with command-line arguments (e.g.
an _http._tcp tube handler that runs "firefox http://127.0.0.1:4242/").

* If I'm going to hand the connection over to someone else, what does it
support connecting to, and how can we do access-control?

In practice, I think the answer will be (IPv4, Localhost).

* Am I going to connect once, or repeatedly?

HTTP is pseudo-connectionless, so you have to give your HTTP library (or web
browser) a host:port and go from there. However, if you're well-integrated
enough to be using GIOStream, it seems unlikely that you're using a protocol
that works like that (it'd be too painful for a start!)

I think we have two cases to deal with here:

Fully-integrated Telepathy app
------------------------------

* Call accept_[and_connect_]async() and get a GIOStream
* Internally, pass around a data structure containing the GIOStream and the
TpStreamTubeChannel
* Use whatever socket type telepathy-glib wants (Unix if supported, else IPv4)
with the best possible access-control

Handover to external process
----------------------------

* You need to know what socket types external processes can use, so nothing
telepathy-glib can do will be good enough for you
* Get the properties and call the Accept() tp_cli API yourself
* You can handle multiple client connections, at your own risk

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list