1

If I use xtigervncviewer to try to connect to a host which doesn't run a VNC server, it prints the following expected error to stderr:

$ xtigervncviewer -AlertOnFatalError=0 localhost

TigerVNC Viewer 64-bit v1.9.0
Built on: 2020-01-23 18:03
Copyright (C) 1999-2018 TigerVNC Team and many others (see README.rst)
See http://www.tigervnc.org for information on TigerVNC.

Fri May  1 15:55:44 2020
 DecodeManager: Detected 4 CPU core(s)
 DecodeManager: Creating 4 decoder thread(s)
 CConn:       unable to create socket: Address family not supported by protocol
              (97)

Alike, if I try to connect to a non-existing host:

$ xtigervncviewer -AlertOnFatalError=0 nonexistinghost

TigerVNC Viewer 64-bit v1.9.0
Built on: 2020-01-23 18:03
Copyright (C) 1999-2018 TigerVNC Team and many others (see README.rst)
See http://www.tigervnc.org for information on TigerVNC.

Fri May  1 16:36:13 2020
 DecodeManager: Detected 4 CPU core(s)
 DecodeManager: Creating 4 decoder thread(s)
 CConn:       unable to resolve host by name: Name or service not known

However, in both cases, the return code is zero:

$ echo $?
0

How can I find out if the connection succeeded or if there was a connection error?

finefoot
  • 2,940
  • 2
  • 21
  • 41
  • what is the purpose of the `AlertOnFatalError` switch? – jsotola May 01 '20 at 14:59
  • @jsotola See https://tigervnc.org/doc/vncviewer.html It only disables the additional message window in X. Regarding the 0 exit code I have filed an issue https://github.com/TigerVNC/tigervnc/issues/1008, let's see if this is a bug or a design decision which I couldn't find anything about in the docs. – finefoot May 01 '20 at 15:08

0 Answers0