Registered signal handler in server function. Also commented out the sleep call in random work to make server run faster.