void tcp_fasttmr(void) { struct tcp_pcb *pcb; ++tcp_timer_ctr; pcb = tcp_active_pcbs; while(pcb != NULL) { if (pcb->last_timer != tcp_timer_ctr) { struct tcp_pcb *next; pcb->last_timer = tcp_timer_ctr; /* send delayed ACKs */ if (pcb->flags & TF_ACK...
void tcp_slowtmr(void)每500ms调用,该函数完成了超时重传,tcp保活功能,并会遍历active和timewait链表的PCB,删除那些超时或者出错的PCB,同时将PCB中unsent队列中的数据发送出去。一般使用tcp_write();写入数据后,数据不会马上发送,而是在定时任务中发送。 1,超时重传 重点的代码注释如下: //请求连接次数超出限制 if...
你可能认为是使用 time 命令来告诉你时间,其实并不是,因为 time 只是一个测量一个进程运行了多少时间...