我正在 Qt 中创建一个 FTP 服务器,但我不确定何时发送 RETR 命令的 226 成功响应代码。
是否在所有数据写入之后、数据连接套接字关闭之前发送:
reply(226);
dataSocket()->disconnectFromHost();
或者我在数据连接套接字关闭后发送它:
dataSocket()->disconnectFromHost();
dataSocket()->waitForDisconnected();
reply(226);
最佳答案
http://www.ietf.org/rfc/rfc959.txt
To prevent a race condition here, the server sends a reply (226) after closing the data connection.
关于ftp - FTP 服务器什么时候应该发送 226?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13785584/