let mut buf:Vec<u8>=Vec::new();
let (mut i, mut buf_size) = (0, 50);
for v in (&stream).bytes() {
i+=1; if i > buf_size { break; }
buf.push(v.unwrap());
}
// ...
// 后续对stream进行的操作均无效,shutdown都无法调用
stream.shutdown(Shutdown::Both).expect("shutdown call failed");
stream.write(reply.as_bytes()).unwrap();
stream.flush().unwrap();