Keep track of number of bits not bytes written.
@@ -25,7 +25,7 @@ impl TcpChannel<TcpStream> {
impl AbstractChannel for TcpChannel<TcpStream>{
#[inline(always)]
fn write_bytes(&mut self, bytes: &[u8]) -> Result<()> {
- self.nbits_written = self.stream.write(bytes)?;
+ self.nbits_written = self.stream.write(bytes)?*8;
Ok(())
}
