On Fri, 23 May 2014, john.flor...@dart.biz wrote:

We use the vncviewer in a kiosk fashion for remote access to industrial 
controls and monitors.  I have developed a
service wrapper around it to keep a persistent connection as the sole X windows 
client.  This normally all works very
good.

While most of our deployments are working great, we have one case where the VNC 
server (sadly, not tigervnc) is regularly
(a few times per hour) causing vncviewer to pop a GUI message indicating "read: 
Connection reset by peer (104)".  I
realize the real problem is almost certainly on the server end, but I wish to 
make my kiosk client more robust.  My
ultimate preference would be for such error messages to be emitted to stderr 
where my service could capture them and
relay them to the appropriate system log.  Most importantly, I don't want vncviewer to 
"hang" with such a message.  I'd
much rather it simply exit (with a non-zero status code) so that my kiosk 
service could restart a fresh viewer and work
the best in can despite the errors.  I really don't mind the GUI messages 
appearing, I just don't want require the user's
interaction to dismiss them.  The kiosk's don't have mice and I've not seen any 
way to give the error messages focus --
that's likely due to fact that I'm not utilizing any window manager.

In reviewing the docs, I don't see any options that would let me get any closer 
to my goal.  Did I overlook something?
 For the record, I don't think a cheat sheet explaining to the user that they can 
"1. hit F8, 2. select 'Exit viewer', 3.
hit Enter" is a very good solution.

Yes, this is a known problem when controlling vncviewer from another application. In ThinLinc, we are using the following patch. Should perhaps be a runtime configuration option instead.

--- vncviewer.cxx       (.../vendor/tigervnc/current/vncviewer) (revision 29006)
+++ vncviewer.cxx       (.../trunk/ctc/vnc/tigervnc/vncviewer)  (revision 29006)
@@ -31,7 +31,13 @@
 #include <locale.h>
 #include <sys/stat.h>

+#include <libgen.h>
+#include <string>
 #ifdef WIN32
+#define ECONNRESET WSAECONNRESET
+#endif
+
+#ifdef WIN32

@@ -501,8 +556,15 @@

   delete cc;

-  if (exitError != NULL)
-    fl_alert("%s", exitError);
+  if (exitError != NULL) {
+    // ECONNRESET is pretty useless error for us, so we avoid displaying
+    // that error.
+    char errbuf[64];
+    sprintf(errbuf, "(%d)", ECONNRESET);

+    if (strstr(exitError, errbuf) == NULL)
+      fl_alert("%s", exitError);
+  }
+


Br, ---
Peter Astrand           ThinLinc Chief Developer
Cendio AB               http://cendio.com
Teknikringen 8          http://twitter.com/ThinLinc
583 30 Linkoping        http://facebook.com/ThinLinc
Phone: +46-13-214600    http://google.com/+CendioThinLinc
------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Tigervnc-users mailing list
Tigervnc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-users

Reply via email to