程序“獲取文件列表、文件名和時間”了之后,就提示“TCP Disconnect”,就無法進入“下載文件”的環(huán)節(jié)。我用“FileZilla Client”軟件模擬,后發(fā)現(xiàn)需要再次“Connect”。有沒有辦法進入“下載文件”的環(huán)節(jié)時重新連接TCP。
這是FileZilla Client”軟件的流程
這是CH579M的FTP_Client例程串口數(shù)據(jù):
FTP Test
net version:16
mac addr:38 3b 26 26 8 28?
WCHNET_LibInit Success
SocketId TCP FTP = 00
PHY Link Success
TCP Connect Success
ftp sockid:0
check type= 01
len= 00000320
LOG:
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 4 of 50 allowed.
220-Local time is now 10:01. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
ftp sockid:0
check type= 01
len= 00000041
LOG:
331 User Firmware OK. Password required
ftp sockid:0
check type= 01
len= 00000032
LOG:
230 OK. Current directory is /
************
login success
*********
login!
ftp sockid:0
check type= 02
len= 00000023
LOG:
200 TYPE is now ASCII
SocketId dat server:1
PORT :PORT 192,168,2,30,15,161
ftp sockid:0
check type= 02
len= 00000040
LOG:
250 OK. Current directory is /firmware
ftp sockid:0
check type= 02
len= 00000029
LOG:
200 PORT command successful
ftp sockid:0
check type= 02
len= 00000042
LOG:
257 "/firmware" is your current location
ftp sockid:0
check type= 02
len= 00000030
LOG:
150 Connecting to port 41143
ftp sockid:0
check type= 02
len= 00000042
LOG:
226-Options: -a -l?
226 4 matches total
TCP Connect Success
WCHNET_FTPGetSockeID:2
ftp sockid:2
check type= 02
len= 00000286
LOG:
drwxr-xr-x? ? 2 1000? ? ? ?www? ? ? ? ? ? ? 4096 Mar 31 14:50 .
drwxr-xr-x? ? 5 1000? ? ? ?www? ? ? ? ? ? ? 4096 Apr? 7 17:21 ..
-rw-r--r--? ? 1 1000? ? ? ?www? ? ? ? ? ? ? ?579 Mar 31 14:51 FTP_TYGV.txt
-rw-r--r--? ? 1 1000? ? ? ?www? ? ? ? ? ? ?20560 Mar 29 18:18 HC-07-B2001.bin
*********
find file
*********
ftp sockid:0
check type= 02
len= 00000050
LOG:
227 Entering Passive Mode (192,168,0,56,155,197)
WCHNET_FTPNoop
TCP Disconnect
**********
search success
*********
SocketId TCP FTP = 00
Error: 17
Error: 17
Error: 17
Send Data fail
顯示“TCP Disconnect”,我嘗試讓TCP重連提示“Error: 17”