Using semaphore to test network timeout