Setting `rfbport` to `-1` disables TCP port listening.
if (rfbunixpath.getValueStr()[0] != '\0') {
listeners.push_back(new network::UnixListener(rfbunixpath, rfbunixmode));
vlog.info("Listening on %s (mode %04o)", (const char*)rfbunixpath, (int)rfbunixmode);
- } else {
+ }
+
+ if ((int)rfbport != -1) {
if (localhostOnly)
createLocalTcpListeners(&listeners, (int)rfbport);
else
.B \-rfbport \fIport\fP
Specifies the TCP port on which x0vncserver listens for connections from
viewers (the protocol used in VNC is called RFB - "remote framebuffer").
-The default port is 5900.
+The default port is 5900. Listening on TCP port can be disabled with
+-\frfbport\fP=-1.
.
.TP
.B \-UseIPv4
.TP
.B \-rfbunixpath \fIpath\fP
Specifies the path of a Unix domain socket on which x0vncserver listens for
-connections from viewers, instead of listening on a TCP port.
+connections from viewers.
.
.TP
.B \-rfbunixmode \fImode\fP
.B \-rfbport \fIport\fP
Specifies the TCP port on which Xvnc listens for connections from viewers (the
protocol used in VNC is called RFB - "remote framebuffer"). The default is
-5900 plus the display number.
+5900 plus the display number. Listening on TCP port can be disabled with
+-\frfbport\fP=-1.
.
.TP
.B \-UseIPv4
.TP
.B \-rfbunixpath \fIpath\fP
Specifies the path of a Unix domain socket on which Xvnc listens for
-connections from viewers, instead of listening on a TCP port.
+connections from viewers.
.
.TP
.B \-rfbunixmode \fImode\fP
if (!desktop[scr]) {
std::list<network::SocketListener*> listeners;
+ bool inetd = false;
if (scr == 0 && vncInetdSock != -1) {
+ inetd = true;
if (network::isSocketListening(vncInetdSock))
{
listeners.push_back(new network::TcpListener(vncInetdSock));
vlog.info("inetd wait");
}
- } else if (((const char*)rfbunixpath)[0] != '\0') {
+ }
+
+ if (!inetd && ((const char*)rfbunixpath)[0] != '\0') {
char path[PATH_MAX];
int mode = (int)rfbunixmode;
vlog.info("Listening for VNC connections on %s (mode %04o)",
path, mode);
- } else {
+ }
+
+ if (!inetd && rfbport != -1) {
const char *addr = interface;
int port = rfbport;
if (port == 0) port = 5900 + atoi(vncGetDisplay());