PingService class

Web 端网络延迟(Ping)测试服务 / Latency (ping) test service for the web.

浏览器无法建立任意 TCP / ICMP 连接,因此:

Constructors

PingService({int defaultPort = 443})
构造 PingService / Creates a PingService.
const

Properties

defaultPort int
TCP 模式下默认探测端口 / Default probe port in TCP mode.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ping({required String host, int count = 4, Duration timeout = const Duration(seconds: 3), Duration interval = const Duration(milliseconds: 200), int? port, PingMode mode = PingMode.tcp}) Future<PingResult>
执行 Ping 测试 / Runs a ping test.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited