ping_win32 0.0.2  ping_win32: ^0.0.2 copied to clipboard
ping_win32: ^0.0.2 copied to clipboard
A simple wrapper for Win32 IcmpSendEcho2 function
ping_win32 #
A simple wrapper for Win32 IcmpSendEcho2 function.
Although there has been a handful of ping implementations that wraps the command-line ping utility and it supports variety of platforms including Windows, on Windows platform, it does not support locales other than en-US and it results in severe incompatibility with other locales.
ping_win32 is a faster, efficient, and better replacement for such ping implementations on Windows.
Getting started #
dart pub add ping_win32
Usage #
PingWin32.ping is the only one function provided by the library:
import 'dart:io';
import 'package:ping_win32/ping_win32.dart';
void main() async {
  final result = await PingWin32.ping(
    InternetAddress.tryParse('192.168.10.12')!,
    timeout: Duration(seconds: 10),
  );
  print(result);
}
The returned value is in IcmpResult class and it has status, roundTripTime, and ttl.