每当我关闭服务器的客户端时,我都会创建一个聊天室,并收到错误代码。它会抛出错误代码为data = c.recv(1024)的错误代码,但我在if语句中为非数据关闭了连接
private void loadNews(ArrayList<String> mySourceList) {
...
// Zip all requests
Observable.zip(requests, new Function<Object[], List<NewsItem>>() {
@Override
public List<NewsItem> apply(Object[] objects) throws Exception {
List<NewsItem> combinedNewsItems = new ArrayList<>();
for (Object response : objects) {
combinedNewsItems.addAll((List<NewsItem>) response);
}
return combinedNewsItems;
}
})
.subscribeOn(Schedulers.io())
...
}
我希望它在客户端关闭或据说关闭时关闭连接,但最终会出现连接重置错误