Allow checking an IP address as well as a socket.