本文主要是介绍tcp_listen_input函数里的发送,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
tcp_listen_input函数里的发送
1.tcp_input 里调用tcp_listen_input
2.tcp_listen_input(struct tcp_pcb_listen *pcb)
{
、、、、、、、
最后有一句
return tcp_output(npcb);
}
3.tcp_output
/**
- Find out what we can send and send it
- @param pcb Protocol control block for the TCP connection to send data
- @return ERR_OK if data has been sent or nothing to send
-
another err_t on error
*/
err_t
*tcp_output(struct tcp_pcb pcb)
{
struct tcp_seg *seg, useg;
u32_t wnd, snd_nxt;
#if TCP_CWND_DEBUG
s16_t i = 0;
#endif / TCP_CWND_DEBUG */
/* pcb->state LISTEN not allowed here */
LWIP_ASSERT(“don’t call tcp_output for listen-pcbs”,
pcb->state != LISTEN);
/* First, check if we are invoked by the TCP input proc
这篇关于tcp_listen_input函数里的发送的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!