I only close the connection after the tcp_recved and pbuf_free yes. However tcp_recved leaves the tcp_pcb->rcv_wnd with one byte short of the original window. I'm using a 2920 byte window but after frame 4 I'm left with 2919 bytes. (That's why the call to tcp_close() sends a RST instead of a FIN)
I'm only using lwip from main as per your instructions. On 2 March 2016 at 14:38, Sergio R. Caprile <[email protected]> wrote: > 1) No I'm not. I've had to completely rewrite the HTTP parser, it wasn't > fully needed because it didn't have to parse headers from the client and > so it was a simple implementation that parsed over and over the same > unless everything came on the same pbuf. > I'm suggesting because I've been there. It is your choice however. You > are free to do whatever you want. > > 3) In tcp_recv() callback, you only call tcp_close() when you get an > indication of a connection close: > err_t myrecv(void *arg, struct tcp_pcb* pcb, struct pbuf *p, err_t err) > { > if ((p == NULL) || (err != ERR_OK)){ > Otherwise, if you decide to close on reception, you should get data first: > tcp_recved(pcb, p->tot_len); > pbuf_free(p); > Do you ? > > If you are on the client side, receiving, you mentioned you called lwIP > from within interrupts and main context. You must not do that. > > > > _______________________________________________ > lwip-users mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/lwip-users >
_______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
