/*-----------------------------------------------------------------------------------*/ struct tcp_pcb * tcp_listen(struct tcp_pcb *pcb) { pcb->state = LISTEN; pcb = memp_realloc(MEMP_TCP_PCB, MEMP_TCP_PCB_LISTEN, pcb); if(pcb == NULL) { return NULL; } tcp_pcb_insert_listen((struct tcp_pcb_listen*)pcb); return pcb; }
/*-----------------------------------------------------------------------------------*/ struct tcp_pcb * tcp_listen(struct tcp_pcb *pcb) { pcb->state = LISTEN; pcb = (struct tcp_pcb*)memp_realloc(MEMP_TCP_PCB, MEMP_TCP_PCB_LISTEN, pcb); if(pcb == NULL) { return NULL; } TCP_REG((struct tcp_pcb **)&tcp_listen_pcbs, pcb); return pcb; }