fn poll_yield_cycling() {
        let mut config = crate::Config::new(crate::PROTOCOL_VERSION).unwrap();
        config
            .load_cert_chain_from_pem_file("examples/cert.crt")
            .unwrap();
        config
            .load_priv_key_from_pem_file("examples/cert.key")
            .unwrap();
        config.set_application_protos(&[b"h3"]).unwrap();
        config.set_initial_max_data(1500);
        config.set_initial_max_stream_data_bidi_local(150);
        config.set_initial_max_stream_data_bidi_remote(150);
        config.set_initial_max_stream_data_uni(150);
        config.set_initial_max_streams_bidi(100);
        config.set_initial_max_streams_uni(5);
        config.verify_peer(false);
        config.enable_dgram(true, 100, 100);

        let mut h3_config = Config::new().unwrap();
        let mut s = Session::with_configs(&mut config, &mut h3_config).unwrap();
        s.handshake().unwrap();

        // Send request followed by DATAGRAM on client side.
        let (stream, req) = s.send_request(false).unwrap();

        s.send_body_client(stream, true).unwrap();

        let ev_headers = Event::Headers {
            list: req,
            has_body: true,
        };

        s.send_dgram_client(0).unwrap();

        // Now let's test the poll counts and yielding.
        assert_eq!(s.poll_server(), Ok((0, Event::Datagram)));

        assert_eq!(s.poll_server(), Ok((stream, ev_headers)));
        assert_eq!(s.poll_server(), Ok((stream, Event::Data)));

        assert_eq!(s.poll_server(), Err(Error::Done));
    }
/// Send a single DATAGRAM and request. Ensure that poll continuously cycles
/// between the two types if the data is not read.
Send a single DATAGRAM and request. Ensure that poll continuously cycles
between the two types if the data is not read.
Send a single DATAGRAM and request . Ensure that poll continuously cycles between the two types if the data is not read .
fn poll_yield_cycling() {
        let mut config = crate::Config::new(crate::PROTOCOL_VERSION).unwrap();
        config
            .load_cert_chain_from_pem_file("examples/cert.crt")
            .unwrap();
        config
            .load_priv_key_from_pem_file("examples/cert.key")
            .unwrap();
        config.set_application_protos(&[b"h3"]).unwrap();
        config.set_initial_max_data(1500);
        config.set_initial_max_stream_data_bidi_local(150);
        config.set_initial_max_stream_data_bidi_remote(150);
        config.set_initial_max_stream_data_uni(150);
        config.set_initial_max_streams_bidi(100);
        config.set_initial_max_streams_uni(5);
        config.verify_peer(false);
        config.enable_dgram(true, 100, 100);
        let mut h3_config = Config::new().unwrap();
        let mut s = Session::with_configs(&mut config, &mut h3_config).unwrap();
        s.handshake().unwrap();
        // Send request followed by DATAGRAM on client side.
        let (stream, req) = s.send_request(false).unwrap();
        s.send_body_client(stream, true).unwrap();
        let ev_headers = Event::Headers {
            list: req,
            has_body: true,
        };
        s.send_dgram_client(0).unwrap();
        // Now let's test the poll counts and yielding.
        assert_eq!(s.poll_server(), Ok((0, Event::Datagram)));
        assert_eq!(s.poll_server(), Ok((stream, ev_headers)));
        assert_eq!(s.poll_server(), Ok((stream, Event::Data)));
        assert_eq!(s.poll_server(), Err(Error::Done));
    }
fn poll_yield_cycling ( ) { let mut config = crate :: Config :: new ( crate :: PROTOCOL_VERSION ) . unwrap ( ) ; config . load_cert_chain_from_pem_file ( " " ) . unwrap ( ) ; config . load_priv_key_from_pem_file ( " " ) . unwrap ( ) ; config . set_application_protos ( & [ b" " ] ) . unwrap ( ) ; config . set_initial_max_data ( 1500 ) ; config . set_initial_max_stream_data_bidi_local ( 150 ) ; config . set_initial_max_stream_data_bidi_remote ( 150 ) ; config . set_initial_max_stream_data_uni ( 150 ) ; config . set_initial_max_streams_bidi ( 100 ) ; config . set_initial_max_streams_uni ( 5 ) ; config . verify_peer ( false ) ; config . enable_dgram ( true , 100 , 100 ) ; let mut h3_config = Config :: new ( ) . unwrap ( ) ; let mut s = Session :: with_configs ( & mut config , & mut h3_config ) . unwrap ( ) ; s . handshake ( ) . unwrap ( ) ; // Send request followed by DATAGRAM on client side. let ( stream , req ) = s . send_request ( false ) . unwrap ( ) ; s . send_body_client ( stream , true ) . unwrap ( ) ; let ev_headers = Event :: Headers { list : req , has_body : true , } ; s . send_dgram_client ( 0 ) . unwrap ( ) ; // Now let's test the poll counts and yielding. assert_eq ! ( s poll_server ( ) Ok ( ( 0 Event Datagram ) ) ) ; assert_eq ! ( s poll_server ( ) Ok ( ( stream ev_headers ) ) ) ; assert_eq ! ( s poll_server ( ) Ok ( ( stream Event Data ) ) ) ; assert_eq ! ( s poll_server ( ) Err ( Error Done ) ) ; }
Send a single DATAGRAM and request.
Send a single DATAGRAM and request .