(bytes: &[u8])
| 269 | NetErrorKind::FrameTooLarge, |
| 270 | "tcp frame queue exceeds max", |
| 271 | )); |
| 272 | } |
| 273 | if n < tmp.len() { |
| 274 | return Ok(()); |
| 275 | } |
| 276 | } |
| 277 | Err(err) if err.kind() == io::ErrorKind::WouldBlock => return Ok(()), |
| 278 | Err(err) => return Err(NetError::from_io(NetErrorKind::Receive, err)), |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | /// Try to write all queued bytes without blocking. |
| 284 | /// |
| 285 | /// Returns `true` when the queue is empty. |