GNOME Bugzilla – Bug 667396
enable gvncviewer example binary to connect to unix domain sockets [PATCH]
Last modified: 2012-07-09 10:53:08 UTC
the examples/gvncviewer.c vnc client is nice and simple, but it appears to be unable to connect to unix domain sockets. the attached patch (applies to 0.5) should enable it to bind to unix domain sockets, such as those set up by qemu -display vnc=unix:/tmp/whatever The logic is: test the provided hostname to see if a matching file exists and is a unix-domain socket. If it is, try to connect to it that way. otherwise, proceed with argument parsing and TCP sockets as usual.
Created attachment 204725 [details] [review] patch against 0.5
Thanks for providing the patch, however, the use of the native sockets API is somewhat non-portable. So instead, I wrote a patch using GSocketAddress to provide equivalent functionality commit 078e3cffaab939151aa6afc2df08f7444f6db9ec Author: Daniel P. Berrange <berrange@redhat.com> Date: Mon Jul 9 11:49:20 2012 +0100 Add support for connecting to GSocketAddress instances To improve UNIX domain socket support, add the ability to open a GSocketAddress instance. Pass the 'hostname' with the addr for the purposes of SASL/TLS hostname verification. Also add another method for opening a FD which accepts a hostname, again for SASL/TLS hostname verification when using a tunnelled socket