Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12599 Discussions

A new problem when uses the ftp service by inetd

Altera_Forum
Honored Contributor II
979 Views

<<<<My English is not good, please forgives.>>>> 

 

When a ftp user will connect the server, inetd then 

starts a ftpd process, but when the ftp user will disconnect, 

the ftpd process did not end. 

 

=============================================================# ps 

PID PORT STAT SIZE SHARED %CPU COMMAND 

...... 

23 S 139K 0K 0.0 /bin/dhcpcd -NRY 

24 S 95K 0K 0.0 /bin/inetd 

25 S 279K 0K 0.0 /bin/boa -c /mnt/cf/httpd/ 

26 S 195K 0K 0.0 /bin/sh 

30 S 287K 0K 0.0 /bin/ftpd 

34 S 287K 0K 0.0 /bin/ftpd 

41 S 287K 0K 0.0 /bin/ftpd 

47 R 83K 0K 0.0 ps 

============================================================== 

now there is 3 ftpd process, but in fact was i has connected thrice , not three users connects. 

 

why?? 

 

<<<<My English is not good, please forgives.>>>> 

thx.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
309 Views

You&#39;re right, at the end of the main function, the ftp server goes into an infinite loop looking for commands to parse but it doesn&#39;t check for a closed socket. 

 

As quirky as it sounds, you need to send a "quit" command at the end of your session in order for the ftp server to shut down.
0 Kudos
Altera_Forum
Honored Contributor II
309 Views

thx for your reply, 

But i cannot guarantee each people all send "quit" at the end of the session. 

 

After I modify the code ( i add a "exit(0);" in the ftpcmd.c after send "bye" to client), 

using the FlashFXP software not to have the question,  

but using the IE not to be good. 

 

I cant qualify the user to use a software to link the ftp service.
0 Kudos
Reply