Summary: | convenience function to listen on an arbitrary Unix socket | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Simon McVittie <smcv> |
Component: | tp-glib | Assignee: | Simon McVittie <smcv> |
Status: | RESOLVED MOVED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | enhancement | ||
Priority: | medium | Keywords: | patch |
Version: | git master | ||
Hardware: | Other | ||
OS: | All | ||
URL: | http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/unix | ||
See Also: | https://bugzilla.gnome.org/show_bug.cgi?id=631314 | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Simon McVittie
2010-10-21 03:59:32 UTC
I assume the branch is actually http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/unix Looks good. Guillaume has reviewed up to and including 1820295f15ee. Following discussion on the GNOME bug regarding portability, I'm not entirely happy with this; I've updated the branch to use a private subdirectory, and added a cleanup function which unlinks the path and removes the directory. More discussion on the GNOME bug -> over there. Implementation r+ from Guillaume up to 99edd4b0d3769, but I'm waiting for the API ideas on the GNOME bug to settle. The need to clean up the temporary directory meant I wanted a better cleanup function, so I encapsulated the "listening thing" as a mini-object. We now have this API: typedef struct _TpUnixListener TpUnixListener; TpUnixListener *tp_unix_listener_new (const gchar *hint, GSocketType type, GError **error); GSocket *tp_unix_listener_get_socket (TpUnixListener *self); /* really returns a GUnixSocketAddress, transfer none */ GSocketAddress *tp_unix_listener_get_address (TpUnixListener *self); const gchar *tp_unix_listener_get_path (TpUnixListener *self, gsize *len); void tp_unix_listener_free (TpUnixListener *self); A non-NULL TpUnixListener can only be created on Unix. Hardcoding "/stream" while the socket could, in theory, have a different GSocketType seems a bit weird. I'm not a big fan of struct as pseudo object. From my experience, we often ends up at some point missing it not being a proper GObject (when you need to pass ref without needing a _copy() for example). This object would be a real object in a proper OOo language. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/45. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.