|
From: | vincent cui |
Subject: | Re: [lwip-users] tcp_sndbuf return 0 when sending file |
Date: | Tue, 8 May 2012 06:23:19 +0000 |
Hi : I use latest LWIP1.4.x from git repo, and found that the problem of receive speed down after sending file 3 times. My code is pasted as following . My system is FreeRTOS + lwip, I think it may be lwip bug
static void close_conn(struct tcp_pcb *pcb) { tcp_arg(pcb, NULL); tcp_sent(pcb, NULL); tcp_recv(pcb, NULL); tcp_close(pcb); } static err_t server_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) { if (err == ERR_OK && p != NULL)
{
tcp_recved(pcb, tot_len);
pbuf_free(p);
}
if (err == ERR_OK && p == NULL) { close_conn(pcb); } return ERR_OK; } static err_t server_accept(void *arg, struct tcp_pcb *pcb, err_t err){ LWIP_UNUSED_ARG(arg); LWIP_UNUSED_ARG(err);
tcp_recv(pcb, server_recv); tcp_err(pcb, NULL);
tcp_sent(pcb, NULL); tcp_poll(pcb, NULL, 0);
return ERR_OK; } static void server_init(void)
{
struct tcp_pcb *pcb;
pcb = tcp_new();
tcp_bind(pcb, IP_ADDR_ANY, 8081);
pcb = tcp_listen(pcb); tcp_accept(pcb, server_accept);
for (;;) {
vTaskDelay(50); } } From:
lwip-users-bounces+address@hidden [mailto:lwip-users-bounces+address@hidden
On Behalf Of Bill Auerbach >I use LWIP 1.3.2, after server receive a lot of data packet from client for a while . >The system performance is lower, anyone know how to perfact it ? I would use lwIP 1.4.1. Why spend all this time developing and testing on something already out of date with known problems fixed in later versions? Bill |
[Prev in Thread] | Current Thread | [Next in Thread] |