/// Call every time you got data from transmission
Call every time you got data from transmission
Call every time you got data from transmission
pub fn input(&mut self, buf: &[u8]) -> KcpResult<bool> {
        match self.kcp.input(buf) {
            Ok(..) => {}
            Err(KcpError::ConvInconsistent(expected, actual)) => {
                trace!(
                    "[INPUT] Conv expected={} actual={} ignored",
                    expected,
                    actual
                );
                return Ok(false);
            }
            Err(err) => return Err(err),
        }
        self.last_update = Instant::now();
        if self.flush_ack_input {
            self.kcp.flush_ack()?;
        }
        Ok(self.try_wake_pending_waker())
    }
pub fn input ( & mut self , buf : & [ u8 ] ) -> KcpResult < bool > { match self . kcp . input ( buf ) { Ok ( .. ) => { } Err ( KcpError :: ConvInconsistent ( expected , actual ) ) => { trace ! ( " " expected actual ) ; return Ok ( false ) ; } Err ( err ) => return Err ( err ) , } self . last_update = Instant :: now ( ) ; if self . flush_ack_input { self . kcp . flush_ack ( ) ? ; } Ok ( self . try_wake_pending_waker ( ) ) }
Call every time you got data from transmission
Call every time you got data from transmission
&mut self
buf
&[u8]