Fixed missing socket import which caused exception handler to fail when connection timed out.