This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ftp server solution for eCos?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]