-
s: reds_init_net, 注册回调reds_accept 创建listen socket,增加监听watch_add(reds_accept),后续加入select监听
-
-
c: RedChannel::run-》RedChannelBase::connect() -》RedPeer::connect_unsecure发送连接请求,等待服务端accept
-
-
s: reds_accept
-
-》spice_server_add_client,reds_handle_new_link
-
-》async_read_handler,异步接收数据,需要客户端发送数据,填充link->link_header结束
-
c: RedChannelBase::link() -》link_mess.channel_type = _type,send 发送link请求,recive等待
-
s: -》reds_handle_read_header_done,
-
-》async_read_handler,填充link->link_mess
-
-》reds_handle_read_link_done
-
—》async_read_handler,填充link->auth_mechanism
-
->reds_handle_auth_mechanism
-
->reds_get_spice_ticket
-
—》async_read_handler,填充link->tiTicketing.encrypted_ticket.encrypted_data
-
—》 reds_handle_ticket
-
->reds_handle_link
-
->if (link->link_mess->channel_type == SPICE_CHANNEL_MAIN) { reds_handle_main_link(link); }
-
async_read_handler-》reds_stream_read堵塞,等待客户端发送消息
-
reds_handle_main_link流程
-》reds_send_link_result(link, SPICE_LINK_ERR_OK);
-
c->s: SPICE_CHANNEL_MAIN s: reds_handle_main_link,此过程的详细步骤如上
-
-
s->c: SPICE_MSG_MAIN_INIT, c: handle_init
-
-
c->s: SPICE_MSGC_MAIN_ATTACH_CHANNELS s: reds_send_channels
-
-
s->c: SPICE_MSG_MAIN_CHANNELS_LIST c: handle_channels