PortService class

TCP 端口连通性检测服务 / TCP port reachability service.

Constructors

PortService({Duration defaultTimeout = const Duration(seconds: 3)})
构造 PortService / Creates a PortService.
const

Properties

defaultTimeout Duration
单次连接默认超时 / Default timeout of a single connection attempt.
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

checkPort({required String host, required int port, Duration? timeout}) Future<PortCheckResult>
检测单个端口是否可连接 / Checks whether a single port accepts connections.
isPortOpen({required String host, required int port, Duration? timeout}) Future<bool>
checkPort 的布尔快捷方式 / Boolean shorthand for checkPort.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scanPorts({required String host, List<int> ports = const <int>[80, 443], Duration? timeout, int concurrency = 12}) Future<List<PortCheckResult>>
并发扫描多个端口 / Scans multiple ports with bounded concurrency.
toString() String
A string representation of this object.
inherited

Operators

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