lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Large File transfer-- FTP lwIP 1.4.1


From: Sergio R. Caprile
Subject: Re: [lwip-users] Large File transfer-- FTP lwIP 1.4.1
Date: Mon, 8 Aug 2016 09:45:38 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

I don't follow your logic, and don't have the time to sort it out. Sorry.

You have a server.
A server receives a request on the rx path, on an rx frame. I wouldn't process that on a poll callback, which is called at fixed intervals. Then the server tries to send something back, and it may have room or not. Since you need to send 1GB, it won't. So, it will probably send something, then exit; or nothing, and exit.
If it sent nothing, you are busted.
If it sent something, then, when the remote end sends an ACK, you will get a call to your tcp_sent, so you can resume sending there. If however, for some reason, since there are probably many other connections or whatever, you can't send, you can't stay waiting in loop, you need to exit. Once you exit, your callback will not be called again since the remote end won't send another ACK... so you are busted again. This is why you need to resume trying to send on your poll callback (or on a timer fired function you control yourself, I bet you get the point: you need to resume LATER, and 'later' means you need a timer. That scheme I sent you on former mail, it works, and it sends data of any size. If you want to reinvent the wheel, you are welcome, it is your call. However, you have an excellent example of a full blown server sending files the correct way in the httpd server in the contrib tree (1.4.1) or the apps dir in git head; that you should follow. The smtp client is also a great example on processing commands and dealing with a state machine and the callbacks.





reply via email to

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