RedLinkInfo *link;
link = reds_init_client_connection(socket);
主要是填充RedsStream的SpiceChannelEventInfo, 在函数外指定其回调stream_read_cb,stream_write_cb,stream_writev_cb
客户端和服务端通信的链路数据,一个socket就有一个连接。也就是一个客户端连接产生一个主通道。
-
struct RedClient {
-
MainChannelClient *mcc;{
-
RedChannelClient base;{
-
RedChannel *channel;
-
RedClient *client;
-
RedsStream *stream;
-
}
-
}
-
}
-
reds_handle_main_link
-
reds_info_new_channel(用link->linkmess更新link->stream的信息,更新为客户端发上来的数据
-
red_client_new(),RedClient是什么
-
main_channel_link,最后调用通用的接口创建MCC
-
main_channel_client_create
-
red_channel_client_create,注册回调red_channel_client_event,初始化RCC的所有参数,
-
包括回调OutgoingHandler,IncomingHandler,SpiceDataHeaderOpaque
-
size = sizeof(MainChannelClient), reds->main_channel = main_channel_init();
-
RedChannel = &main_chan->base,
阅读(1222) | 评论(0) | 转发(0) |