VNC protocol suggestion

Christian Brunschen cb "at" df.lth.se
Wed, 18 Mar 1998 14:05:39 +0000


Hi,

I have been thinking a little.

I like the fact that several users can share a view of the VNC desktop
(ie, several clients can connect to the same server), but I think the
mechanism for interacting in this way is a bit flawed.

Currently, when a client connects, it can either

a) request that all other currently connected clients be disconnected, or
b) just connect regardless.

This is all nice and dandy, but there should be more control, I think.

Basically, I think there should be a part of the VNC protocol, which sort
of lies outside the RFB protocol, which basically does something like the
following. Upon the inital connection (after authentication etc), but
_before_ the client sends its forst RequestFrameBufferUpdate message,
client and server can exchange 'connection mode configuation' requests and
responses. Something like the following

typedef struct {
	CARD8 type,		// magic number as usual
	CARD8 modeMask
} vnc_ConnectionModeRequestMsg;

where modeMask is the bitwise OR of:

0x01		disconnect currently connected clients
0x02		deny new connections while I am connected
0x04		inform me of connection attempts (I am paranoid)
0x10		disallow further input from currently connected clients
		(grab the input away from them, but allow them to remain
		connected and see what we are doing)
0x20		allow new connections, but don't let them send input
0x40		inform/ask me if someone tries to grab input focus away
		from me

The current 'shared desktop' mode would have a modeMask of 0, and the
current non-shared desktop would have a modeMask of 1.

The server would respond with some sort of acknowledgement message,
probably looking much the same, telling the client which modeMask it
_actually_ managed to get.

Furthermore, if we are not disallowing new connections, then - if a new
client connects to the same server we're connected to, and requests that
we get discnnected - the server sends us a

typedef struct {
	CARD8 type,
	CARD8 modeMask
} vnc_newClientWantsToDisconnectYouMsg;

so that we can either accept or deny the request, by sending the server an
appropriate message indicating the mode we want to allow not for our own,
but for the new client's connection.

What each client does if it does not get what it wants is obviously up to
the client, but, for instance, my client could always pop up a dialog and
ask me 'someone else wants to look at your desktop, and wants to
disconnect you - [ Stay stubborn ]  [ Disconnect ]' or something.
Likewise, I might want to know if someone else is taking a look at my
desktop; I might allow pretty free access that way, as long as noone else
can input anything.

Basically, something like this (I have probably missed / overlooked a
number of omportant things) allows a lot more flexibility _if you need
it_. If you don't, all clients just connect with modeMask = 0 or 1,
corresponding to the current scheme.

Of course, the client might send a mode change request to the server at
any time, enforcing or lifting restrictions; likewise, information from
the server can come to the client at any time.

However, this part of the protocol is not really part of the 'remote frame
buffer' stuff, imho, so should be seen as something apart from rfb. After
all, the messages etc described above might apply to an entirely different
type of connection than rfb just as well.

Comments anyone ?

Best regards // Christian Brunschen