The main program 85 The first thing we do is to make sure our main. rs file is set up correctly: ch04/a-epoll/src/main. rs use std::{io::{self, Read, Result, Write}, net::Tcp Stream}; use ffi::Event; use poll::Poll; mod ffi; mod poll; We import a few types from our own crate and from the standard library, which we'll need going forward, as well as declaring our two modules. We'll be working directly with Tcp Streams in this example, and that means that we'll have to format the HTTP requests we make to our delayserver ourselves. The server will accept GET requests, so we create a small helper function to format a valid HTTP GET request for us: ch04/a-epoll/src/main. rs fn get_req(path &str)-> Vec<u8> { format!( "GET {path} HTTP/1. 1\r\n\ Host: localhost\r\n\ Connection: close\r\n\ \r\n" ) } The preceding code simply takes a path as an input argument and formats a valid GET request with it. The path is the part of the URL after the scheme and host. In our case, the path would be everything in bold in the following URL: http://localhost:8080 /2000/hello-world. Next up is our main function. It's divided into two parts: Setup and sending requests Wait and handle incoming events