metartc5_jz源码阅读-udp->receive

之前在metartc5_jz源码阅读-yang_run_rtcudp_thread-CSDN博客中说到:

//调用udp的receive方法将读取的buffer和udp->user传入。
if (udp->receive)	udp->receive(buffer, len, udp->user);

这个函数在以下代码中已经设置执行函数:

session->context.udp->session.receive = g_session_receive;
void g_session_receive(char *data, int32_t nb_data, void *user) {
	if (user == NULL)		return;
	//让RtcConnection执行receive方法,传入RtcSession,data和datasize
	YangRtcConnection *conn = (YangRtcConnection*) user;
	conn->receive(conn->session,data,nb_data);
}

以下代码设置了conn->receive的实际执行函数

conn->receive=yang_rtcconn_receive;

 

 

 

你可能感兴趣的:(metartc5_jz源码阅读,音视频,c语言,p2p,实时音视频)