lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] LwIP 2.1.2 and receive big file


From: Rustam Mustafin
Subject: [lwip-devel] LwIP 2.1.2 and receive big file
Date: Wed, 28 Oct 2020 02:42:26 +0500

Good afternoon!

I am using LwIP (2.1.2) and FreeRTOS (10.3.1). LwIP in socket mode. Now I use the tcp / ip stack to create a web server. I encountered strange behavior when requesting files (pictures) from the device. On my local machine (192.168.127.2), I use wget to download files from the device (192.168.127.1). If a 505 byte icon is requested, the device sends the file normally. At the end, I see a FIN send from the device and a FIN response from the client. When I request a picture of 56 728 bytes, I see that the device has completely sent the file, but the connection is not closed. The wget utility shows that the connection is open and the file is still downloading. Although it has already downloaded (checked with binary comparison). In the case of using a browser, the pages from the device are simply not displayed, since the files hang during the transfer.

What could be the reason for this behavior? Perhaps something needs to be changed in the configuration parameters? Tried reducing the LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT timeouts, however the connection still won't close. (I looked at Wireshark).

// Implementation pseudocode:
void WebClientTask (void * p)
{
// recv (clientSock, buf1)
// find file
// write (clientSock, buf2)

// close connection
lwip_shutdown (clientSock, SHUT_RDWR);
lwip_close (clientSock);

// delete task
}

void WebServerTask (void * p)
{
// server socket
// listen
while (1) {
cl = accept
createNewTaskForClient (cl)
}
}

Attachment: lwipopts.h
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]