The problem with timeouts
In this section, we will explore a potential improvement we can make to our ping test application: handling timeouts. Timeouts typically occur when the server takes an unusually long time to process a specific request, and the connection between the server and its client is terminated.
In the context of a ping test application, we will be implementing a customized threshold for the timeout. Recall that a ping test is used to determine whether specific servers are still responsive, so we can specify in our program that, if a request takes more than our timeout threshold for the server to respond, we will categorize that specific server with a timeout.
Support from httpstat.us and simulation in Python
In addition to different options for status codes, the httpstat.us website also provides us with a way to simulate a delay in its response when we send in requests. Specifically, we can customize the delay time (in milliseconds) with a query argument in...