init method
Initialize the ping service with custom settings. If not called, defaults to pinging Google DNS (8.8.8.8:443) every 2 seconds.
Implementation
void init({
String? targetIp,
int? targetPort,
Duration? interval,
Duration? timeout,
}) {
if (targetIp != null) _targetIp = targetIp;
if (targetPort != null) _targetPort = targetPort;
if (interval != null) _interval = interval;
if (timeout != null) _timeout = timeout;
}