其他分享
首页 > 其他分享> > 关于FTPClient卡死问题

关于FTPClient卡死问题

作者:互联网

ftpclient在调用retrieveFileStream(String remote)之后,返回inputstream

如果不想关闭ftp,继续读取其他文件

一定要先关闭inputstream,然后再调用completePendingCommand 方法。

这样可以继续读取另外的文件,否则很大的可能会程序卡死。

原因是completePendingCommand()会一直在等FTP Server返回226 Transfer complete,

但是FTP Server只有在接受到InputStream执行close方法时,才会返回

标签:返回,FTP,completePendingCommand,Server,关于,卡死,inputstream,FTPClient
来源: https://www.cnblogs.com/enjoybeng/p/15533451.html