|
From: | Peter Jančo |
Subject: | [lwip-users] File transfer over TCP/IP |
Date: | Tue, 10 Jan 2012 11:21:38 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.2.25) Gecko/20111213 Thunderbird/3.1.17 |
Hi, I write FTP server on LPC2478 and uEZ1.11 platform. There is a simple loop where is recieving data from FTP client. struct netbuf *inbuf; while(1) { inbuf = NULL; inbuf = netconn_recv(conn_data); if(inbuf) { netbuf_copy(inbuf,BlockBuffer,inbuf->ptr->tot_len); UEZFileWrite(file,BlockBuffer,inbuf->ptr->tot_len,NULL);//store data to filesystem netbuf_delete(inbuf); } else break; } FTP client (Total Commander) split the big file into few packets. For example file with total length 9130B is split like this: 512B,988B,1460B,1460B,1460B,1460B,1460B,40B,290B First 8 packets is received always fine. The last packet (290B) is received just sometimes. So the received file have length only 8840B. Connection timeout is set to 0 (infinite). I have captured ethernet communication between FTP server (LPC2478) and FTP client (my PC). LPC2478 don't recieve 290B packet at first attempt. After that PC send retransmission with data length 330B. I don't understand why. This is not the same packet which I lost. Data in this packet is identical like in the 40B packet and 290B together. After them is connection closed. Why I have problem with receiving the last data packet? Best regards Peter Janco. |
[Prev in Thread] | Current Thread | [Next in Thread] |