Some optimizations in the ServerPing to remove the SuppressWarnings and the deprecation.