This example demonstrates sending a couple of messages to the example.com
domain (just for an example, you should enter here your server):
(examples/minimal.rs
)
```rust
use std::io::IoVec; use std::net::UdpSocket;
use aneviconcore::summary::TestSummary; use aneviconcore::tester::Tester;
fn main() { // Setup the socket connected to the example.com domain let socket = UdpSocket::bind("0.0.0.0:0").unwrap(); socket.connect("93.184.216.34:80").unwrap();
// Setup all the I/O vectors (messages) we want to send
let paylod = &mut [
(0, IoVec::new(b"Generals gathered in their masses")),
(0, IoVec::new(b"Just like witches at black masses")),
(0, IoVec::new(b"Evil minds that plot destruction")),
(0, IoVec::new(b"Sorcerers of death's construction")),
];
// Send all the created messages using only one system call
let mut summary = TestSummary::default();
let mut tester = Tester::new(&socket, &mut summary);
println!(
"The total packets sent: {}, the total seconds passed: {}",
tester.send_multiple(paylod).unwrap(),
summary.time_passed().as_secs()
);
} ```
This is how you are able to build your own stress-testing bot. Now you can follow the official documentation to learn more about the anevicon_core
abstractions.