Search code examples
vnc

How RealVNC works?


I would to know how RealVNC remote viewer works.

It frequently send screenshots to the client in real time ?

or does it use other approach ?


Solution

  • As a very high-level overview, there are two types of VNC servers:

    1. Screen-grabbing. These servers will capture the current display into a buffer, compare it to the client state, and send only the rectangles that differ to the client.
    2. Hook-assisted. Hooking into the display update process, these servers will be informed when the screen changes by the display manager or OS. They can then use that information to send only the changed rectangles to the client.

    In both cases, it is effectively a stream of screen updates; however, only the changed regions of the screen are transmitted to the client. Depending on the version of the VNC protocol in use, these updates may be compressed as well.

    (Note that the client is free to request a complete screen update any time it wants to, but the server will only do this on its own if the entire screen is changed.)

    Also, screen updates are not the only things transmitted. There are separate channels that the server can use to send clipboard updates and mouse position updates (since a user physically at the remote machine may be able to move the mouse too).