fn receive_preface(&mut self) -> Result<()> {
        // read settings frame
        if let FrameKind::Settings(frame) = try!(self.conn.read_frame(100)) {
            if frame.is_ack() {
                return Err(Error::new(ErrorKind::Protocol, "Invalid Preface, received ACK"));
            }
        } else {
            return Err(Error::new(ErrorKind::Protocol, "Invalid Preface, bad frame"));
        }
        Ok(())
    }
/// check preface
/// first received frame must be a valid settings frame
check preface
first received frame must be a valid settings frame
check preface first received frame must be a valid settings frame
fn receive_preface(&mut self) -> Result<()> {
        // read settings frame
        if let FrameKind::Settings(frame) = try!(self.conn.read_frame(100)) {
            if frame.is_ack() {
                return Err(Error::new(ErrorKind::Protocol, "Invalid Preface, received ACK"));
            }
        } else {
            return Err(Error::new(ErrorKind::Protocol, "Invalid Preface, bad frame"));
        }
        Ok(())
    }
fn receive_preface ( & mut self ) -> Result < ( ) > { // read settings frame if let FrameKind :: Settings ( frame ) = try ! ( self conn read_frame ( 100 ) ) { if frame . is_ack ( ) { return Err ( Error :: new ( ErrorKind :: Protocol , " " ) ) ; } } else { return Err ( Error :: new ( ErrorKind :: Protocol , " " ) ) ; } Ok ( ( ) ) }
check preface
first received frame must be a valid settings frame
check preface first received frame must be a valid settings frame
&mut self
&mut self