Detailed explanation of spice protocol (3): spice architecture and communication

1. Related concepts

Channel:
Client and server interact through channels. Each channel type is dedicated to the transmission of a particular data type. Each channel uses a dedicated TCP socket, which may be secure (encrypted with SSL) or insecure. There is a dedicated thread for each channel on the client side. Therefore, through different thread priorities, each channel is scheduled to have different transmission functions. The channels include:

  • Main channel (main), the main channel implemented by RedClient;
  • Display channel (display channel), handles graphics commands, images and video data streams;
  • Inputs channel, used for mouse and keyboard input;
  • Position channel (cursor channel), indicating the device's position, visibility and cursor shape;
  • Audio playback channel (playback channel) indicates audio from the server to be played by the client;
  • Audio capture channel (record channel), indicating the audio captured by the client;
  • Each Channel is a network connection between the client and the server.

The client implements each Channel as a separate thread by defining a RedChannel base class that runs as a separate thread, and then derives the required specific functional classes from this base class.
After the client is started, it will first establish a connection with the server. This connection is MAIN_CHANNEL. After MAIN_CHANNEL is established, the client first sends a query command to the server to request the Channel type supported by the server. Then the client creates correspondences for all supported Channels one by one. Channel class instance, each instance will start its own working thread and initiate a connection request to the server to establish a network connection.

1. Related concepts

Channel:
Client and server interact through channels. Each channel type is dedicated to the transmission of a particular data type. Each channel uses a dedicated TCP socket, which may be secure (encrypted with SSL) or insecure. There is a dedicated thread for each channel on the client side. Therefore, through different thread priorities, each channel is scheduled to have different transmission functions. The channels include:

  • Main channel (main), the main channel implemented by RedClient;
  • Display channel (display channel), handles graphics commands, images and video data streams;
  • Inputs channel, used for mouse and keyboard input;
  • Position channel (cursor channel), indicating the device's position, visibility and cursor shape;
  • Audio playback channel (playback channel) indicates audio from the server to be played by the client;
  • Audio capture channel (record channel), indicating the audio captured by the client;
  • Each Channel is a network connection between the client and the server.

The client implements each Channel as a separate thread by defining a RedChannel base class that runs as a separate thread, and then derives the required specific functional classes from this base class.
After the client is started, it will first establish a connection with the server. This connection is MAIN_CHANNEL. After MAIN_CHANNEL is established, the client first sends a query command to the server to request the Channel type supported by the server. Then the client creates correspondences for all supported Channels one by one. Channel class instance, each instance will start its own working thread and initiate a connection request to the server to establish a network connection.

Guess you like

Origin blog.csdn.net/tangsiqi130/article/details/132668003