Home > Mobile >  Qftp connect FTP, but other clients can connect
Qftp connect FTP, but other clients can connect

Time:05-18

Deployment good FTP server, the client can be A normal login connection, unable to connect to and log in, but the client B
The login code is:
 
Void FtpHelper: : ConnectToFtp ()
{
M_isPutting. Store (false);

If (m_pFtp!=NULL)
{
M_pFtp - & gt; Close ();
The delete m_pFtp;
M_pFtp=NULL;
}
M_pFtp=new QFtp (this);
M_pFtp - & gt; ConnectToHost (m_serverIp, 21);
M_pFtp - & gt; Login (m_userId m_password);
//Qftp is asynchronous and can only use groove to deal with the operation after completion of the command
The connect (m_pFtp, SIGNAL (commandFinished (int, Boolean)), and this, SLOT (ftpCommandFinished (int, Boolean)));
The connect (m_pFtp, SIGNAL (listInfo (const QUrlInfo & amp;) ), this SLOT (ftpListInfo (const QUrlInfo & amp;) ));
The connect (m_pFtp, SIGNAL (stateChanged (int)), and this, SLOT (ftpStateChanged (int)));
VLogInfo (" [FTP] start to connect and login FTP [% s] ", m_serverIp. ToLatin1 (). The data ());
}


User name password is anonymous
Client B shows the log is
00:01:06. 890 [00005250] [INFO] [FTP] start to connect and login FTP [] 10. XXX
00:01:07. 062 [00005250] [the DEBUG] [FTP] [stateChanged] [QFtp: : HostLookup]
00:01:07. 062 [00005250] [the DEBUG] [FTP] [stateChanged] [QFtp: : Connecting]

The client is A display of log
17:04:27. 998 [00000634] [INFO] [FTP] start to connect and login FTP [] 10. XXX
17:04:28. 076 [00000634] [the DEBUG] [FTP] [stateChanged] [QFtp: : HostLookup]
17:04:28. 076 [00000634] [the DEBUG] [FTP] [stateChanged] [QFtp: : Connecting]
17:04:28. 076 [00000634] [the DEBUG] [FTP] [stateChanged] [QFtp: : Connected]
17:04:28. 076 [00000634] [the DEBUG] [FTP] [stateChanged] [QFtp: : LoggedIn]
17:04:28. 076 [00000634] [INFO] [FTP] [0] FTP connect success!

Feeling is connection is not connected, but directly from the browser on the client B can log in, this may be what reason?

CodePudding user response:

But the client B on the c # write a client, also can access the FTP, good strange
  •  Tags:  
  • Qt
  • Related