fn multiple_dgram_overflow() {
        let mut buf = [0; 65535];
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();

        // We'll send default data of 10 bytes on flow ID 0.
        let result = (11, 0, 1);

        // Five DATAGRAMs
        s.send_dgram_client(0).unwrap();
        s.send_dgram_client(0).unwrap();
        s.send_dgram_client(0).unwrap();
        s.send_dgram_client(0).unwrap();
        s.send_dgram_client(0).unwrap();

        // Only 3 independent DATAGRAM events will fire.
        assert_eq!(s.poll_server(), Ok((0, Event::Datagram)));
        assert_eq!(s.recv_dgram_server(&mut buf), Ok(result));
        assert_eq!(s.poll_server(), Err(Error::Done));
        assert_eq!(s.recv_dgram_server(&mut buf), Ok(result));
        assert_eq!(s.poll_server(), Err(Error::Done));
        assert_eq!(s.recv_dgram_server(&mut buf), Ok(result));
        assert_eq!(s.poll_server(), Err(Error::Done));
        assert_eq!(s.recv_dgram_server(&mut buf), Err(Error::Done));
        assert_eq!(s.poll_server(), Err(Error::Done));
    }
/// Send more DATAGRAMs than the send queue allows.
Send more DATAGRAMs than the send queue allows.
Send more DATAGRAMs than the send queue allows .
fn multiple_dgram_overflow() {
        let mut buf = [0; 65535];
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();
        // We'll send default data of 10 bytes on flow ID 0.
        let result = (11, 0, 1);
        // Five DATAGRAMs
        s.send_dgram_client(0).unwrap();
        s.send_dgram_client(0).unwrap();
        s.send_dgram_client(0).unwrap();
        s.send_dgram_client(0).unwrap();
        s.send_dgram_client(0).unwrap();
        // Only 3 independent DATAGRAM events will fire.
        assert_eq!(s.poll_server(), Ok((0, Event::Datagram)));
        assert_eq!(s.recv_dgram_server(&mut buf), Ok(result));
        assert_eq!(s.poll_server(), Err(Error::Done));
        assert_eq!(s.recv_dgram_server(&mut buf), Ok(result));
        assert_eq!(s.poll_server(), Err(Error::Done));
        assert_eq!(s.recv_dgram_server(&mut buf), Ok(result));
        assert_eq!(s.poll_server(), Err(Error::Done));
        assert_eq!(s.recv_dgram_server(&mut buf), Err(Error::Done));
        assert_eq!(s.poll_server(), Err(Error::Done));
    }
fn multiple_dgram_overflow ( ) { let mut buf = [ 0 ; 65535 ] ; let mut s = Session :: default ( ) . unwrap ( ) ; s . handshake ( ) . unwrap ( ) ; // We'll send default data of 10 bytes on flow ID 0. let result = ( 11 , 0 , 1 ) ; // Five DATAGRAMs s . send_dgram_client ( 0 ) . unwrap ( ) ; s . send_dgram_client ( 0 ) . unwrap ( ) ; s . send_dgram_client ( 0 ) . unwrap ( ) ; s . send_dgram_client ( 0 ) . unwrap ( ) ; s . send_dgram_client ( 0 ) . unwrap ( ) ; // Only 3 independent DATAGRAM events will fire. assert_eq ! ( s poll_server ( ) Ok ( ( 0 Event Datagram ) ) ) ; assert_eq ! ( s recv_dgram_server ( mut buf ) Ok ( result ) ) ; assert_eq ! ( s poll_server ( ) Err ( Error Done ) ) ; assert_eq ! ( s recv_dgram_server ( mut buf ) Ok ( result ) ) ; assert_eq ! ( s poll_server ( ) Err ( Error Done ) ) ; assert_eq ! ( s recv_dgram_server ( mut buf ) Ok ( result ) ) ; assert_eq ! ( s poll_server ( ) Err ( Error Done ) ) ; assert_eq ! ( s recv_dgram_server ( mut buf ) Err ( Error Done ) ) ; assert_eq ! ( s poll_server ( ) Err ( Error Done ) ) ; }
Send more DATAGRAMs than the send queue allows.
Send more DATAGRAMs than the send queue allows .