Create Your Own Event Queue 92 content-length: 9 connection: close content-type: text/plain; charset=utf-8 date: Wed, 04 Oct 2023 15:29:13 GMT request-0------FINISHED As you see, the responses are sent in reverse order. Y ou can easily confirm this by looking at the output on the terminal on running the delayserver instance. The output should look like this: #1-5000ms: request-0 #2-4000ms: request-1 #3-3000ms: request-2 #4-2000ms: request-3 #5-1000ms: request-4 The ordering might be different sometimes as the server receives them almost simultaneously, and can choose to handle them in a slightly different order. Say we track events on the stream with ID 4: 1. In send_requests, we assigned the ID 4 to the last stream we created. 2. Socket 4 sends a request to delayserver, setting a delay of 1,000 ms and a message of request-4 so we can identify it on the server side. 3. We register socket 4 with the event queue, making sure to set the epoll_data field to 4 so we can identify on what stream the event occurred. 4. delayserver receives that request and delays the response for 1,000 ms before it sends an HTTP/1. 1 200 OK response back, together with the message we originally sent. 5. epoll_wait wakes up, notifying us that an event is ready. In the epoll_data field of the Event struct, we get back the same data that we passed in when registering the event. This tells us that it was an event on stream 4 that occurred. 6. We then read data from stream 4 and print it out. In this example, we've kept things at a very low level even though we used the standard library to handle the intricacies of establishing a connection. Even though you've actually made a raw HTTP request to your own local server, you've set up an epoll instance to track events on a Tcp Stream and you've used epoll and syscalls to handle incoming events. That's no small feat-congratulations!