
--> see the picture thread_structure.fig or thread_structure.eps

--------------------
Main-/Grabber-Thread
--------------------

- calls library init routines
  (eric_firmware/eric_vnc/src/main.c)

- setup openssl library and starts the Listener-Thread
  (eric_firmware/liberic_net/src/init.c)

- starts the Video-Grab-Loop (this is no seperate thread!)

- calls library cleanup routines on finish (actually don't finish in normal
  circumstances)
  (eric_firmware/eric_vnc/src/main.c)

---------------
Listener-Thread
---------------

- Listens on network ports and starts a Multiplexer-Thread for every client.
  (eric_firmware/liberic_net/src/net.c)

--------------------------------
Multiplexer-/Reader-/Webs-Thread
--------------------------------

- Decides if the request is using RFB or HTTP (with or without encryption)
  (eric_firmware/liberic_net/src/multiplexer.c
   eric_firmware/liberic_net/src/rfb_check_bio.c)

- If the request is using RFB it creates and initializes a new
  RFB-Client structure and starts a Writer-Thread. The Multiplexer
  is now in the role of the Reader-Thread and handles incoming
  RFB-requests.
  (eric_firmware/liberic_rfb/src/clients.c)

- If the request is using HTTP we handle it (protected by a global mutex)
  (eric_firmware/liberic_webs/src/webs.c)


-------------
Writer-Thread
-------------

- This thread handels all color-space-translation / encoding and
  network writes to RFB Clients
  (eric_firmware/liberic_rfb/src/writer.c)
