This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Ftp server solution for eCos?
- From: Stanislav Meduna <stano at meduna dot org>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 01 Jun 2011 09:33:37 +0200
- Subject: Re: [ECOS] Ftp server solution for eCos?
- References: <BANLkTim8gJ4mwr3fN=ekW7NPr_VPOdkNpA@mail.gmail.com> <4DE5385E.8010007@meduna.org> <6EE7D1502C48E44E92DCADF9DD3E0DB90187A6BA9717@SRV-VS06.TELEVIC.COM>
On 01.06.2011 08:43, Lambrecht Jürgen wrote:
> 2 remarks out of my experience:
> - Be aware that if you use JFFS2 as filesystem, that it is best
> to use the node size as write buffer (after the fopen):
> setvbuf(file, NULL, _IOFBF, PAGE_SIZE); //set stdio buffer size to jffs2 node size!
Good point. My server does not use fopen & friends - instead
the low-level open/read/write/close are used and the size
of the transfer can be configured using
CYGNUM_NET_FTPSERVER_XFER_BUFFER_SIZE.
> - FTP consumes a lot of sockets. But sockets in ecos are statically
> allocated, and their numer is set at compile time. So, when fastly
> changing from directory in an ftp session, the ftp server will hang
> for a while, waiting for sockets to be released.
You mean the sockets remain in the TIME_WAIT state, so they
are not available until a TCP timer expires? Good point.
The CD is probably not a problem, but any command using
the data connection can be. I don't know what eCos does
in this situation, but it is surely one thing to keep
in mind.
My port allows to both configure the max. number of clients
allowed (CYGNUM_NET_FTPSERVER_MAX_CLIENTS) and set it
at runtime (max_nr_of_clients), so at least the number
of sockets actually used is bound.
> It could also be necessary to increase that default number - if
> I remember well, you have to increase the max number of open files
> instead of the max no of open sockets.
Yes, there are things that has to be adjusted when using
network applications using non-trivial amounts of sockets
and files.
Regards
--
Stano
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss