现在的位置: 首页 > 综合 > 正文

Spice代码阅读一:Spice Client 与 Spice Server 通道建立过程

2017年08月27日 ⁄ 综合 ⁄ 共 889字 ⁄ 字号 评论关闭


 

文件

方法

描述

Application.cpp

init_globals()

初始化Log,ssl库,canvas(或opengl canvas)和quic压缩库

 

Process_cmd_line()

解析命令行连接参数

 

init_platform_globals()

分别对windows和linux 平台初始化显示、键盘和窗口等

 

init_remainder()

初始化监视器、菜单(快捷键)和事件侦听等

 

Run()

调用ProcessLoop的run()

ProcessLoop

Run()

 

Application.cpp

on_start_running()

调用 connect()

 

Connect()

调用Red_client.cpp的connect(),唤醒等待的线程

Red_channel.cpp

Run()

调用RedChannelBase的connect()方法

Red_Peer.cpp

Connect_secure()

Connect_unsecure()

根据配置,采用安全或非安全连接,实际连接到server端

Red_channel.cpp

Link()

发送 SpiceLinkMess,接收公钥,加密密码,发送密码,检查连接结果;交换各自的capabilities

 

On_event()

调用 Receive_message()

 

Receive_messages()

在Main Channel建立以后,client开始等待接收server发过来的后续消息,依次处理,调用handle_message()

 

handle_message()

调用 Generated_client_demarshallers.c::Parse_MainChannel_msg()解析消息

Red_client.cpp

Handle_xxx()

根据消息类型,调用相应的处理handle进行处理,处理诸如:RED_MAIN_INIT = 103

RED_MAIN_CHANNELS_LIST = 104

之类的消息,建立后续的channel

 

Create_Channel()

建立其他的channel,整个连接过程结束。

抱歉!评论已关闭.