这种作法是错误的。
文档中对ready()的说明:
True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.即使数据流现在是阻塞状态也不能就判断Welcome信息读取完了。Welcome信息是以什么方式结束应该看FTP协议的规定。比如:两个回车换行符号“\r\n\r\n”表示结束。
文档中对ready()的说明:
True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.即使数据流现在是阻塞状态也不能就判断Welcome信息读取完了。Welcome信息是以什么方式结束应该看FTP协议的规定。比如:两个回车换行符号“\r\n\r\n”表示结束。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货