On Mon, 25 May 2009, Olivier Hervieu wrote:
> Attach to this mail, you will find an exemple showing how to makes X11
> forwarding works with libssh2. This exemple allocates a shell where you can
> request X ressources.
Thanks!
But whoa. That's extremely complicated. Is it really necessary to do it that
way just to get X11 forwarding to work? Or perhaps the question should rather
be put: what should we do to libssh2 to make this a lot less complicated?
The example is full of flaws as well:
A) why wait for 10 *microseconds* in the select() used in the main function?
Why not 10 seconds or something?
B) the select() in x11_send_receive() does no timeout at all but why is there
a select() at all? libssh2 sets the socket to a non-blocking state by
itself so you can't block on the read() call done there anyway.
C) libssh2_poll() is deprecated and should not be used and I also can't see
the point with its use in the example
I also re-indented it somewhat to better adhere to our style and I removed a
bunch of compiler warnings. The current version is attached.
-- / daniel.haxx.se
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel