# 读取 tcp 127.0.0.1:8080->127.0.0.1:5000: 读取：对端重置连接

- **ID:** `go/io-reader-error`
- **领域:** go
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

远程对端在读取操作期间强制关闭连接，导致 io.Read 错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.21 | active | — | — |

## 解决方案

1. **** (70% 成功率)
   ```
   if netErr, ok := err.(net.Error); ok && netErr.Timeout() { /* handle timeout */ }
   ```
2. **** (80% 成功率)
   ```
   Re-establish the connection on error
   ```

## 无效尝试

- **** — Connection is already closed, retry won't work (90% 失败率)
- **** — Leads to incomplete data (80% 失败率)
