reconnect method
手动重连(用于用户界面)
Implementation
Future<void> reconnect() async {
if (_connected) {
await _disconnect();
}
_reconnectTimer?.cancel();
_reconnectTimer = null;
if (_manualHost != null && _manualPort != null) {
await _connect(_manualHost!, _manualPort!, path: _manualPath);
} else {
await _stopServiceDiscovery();
await _startServiceDiscovery();
}
}