/// Write given data using the underlaying SSL stream.
Write given data using the underlaying SSL stream.
Write given data using the underlaying SSL stream .
fn write<H: Handler>(
        &mut self, 
        data: &[u8], 
        event_loop: &mut EventLoop<H>) -> Result<usize> {
        match self.stream.ssl_write(data) {
            Err(ssl::error::Error::WantRead(_)) => {
                self.state = ArrowStreamState::WriterWantRead;
                self.enable_socket_events(true, false, event_loop);
                Ok(0)
            },
            Err(ssl::error::Error::WantWrite(_)) => {
                self.state = ArrowStreamState::WriterWantWrite;
                self.enable_socket_events(false, true, event_loop);
                Ok(0)
            },
            other => {
                self.state = ArrowStreamState::Ok;
                self.enable_socket_events(true, true, event_loop);
                Ok(try_io!(other))
            }
        }
    }
fn write < H : Handler > ( & mut self , data : & [ u8 ] , event_loop : & mut EventLoop < H > ) -> Result < usize > { match self . stream . ssl_write ( data ) { Err ( ssl :: error :: Error :: WantRead ( _ ) ) => { self . state = ArrowStreamState :: WriterWantRead ; self . enable_socket_events ( true , false , event_loop ) ; Ok ( 0 ) } , Err ( ssl :: error :: Error :: WantWrite ( _ ) ) => { self . state = ArrowStreamState :: WriterWantWrite ; self . enable_socket_events ( false , true , event_loop ) ; Ok ( 0 ) } , other => { self . state = ArrowStreamState :: Ok ; self . enable_socket_events ( true , true , event_loop ) ; Ok ( try_io ! ( other ) ) } } }
Write given data using the underlaying SSL stream.
Write given data using the underlaying SSL stream .
&mut self
data
&[u8]
event_loop
&mut EventLoop<H>