ping method
Ping server with configuration
Implementation
@override
Future<int> ping(String config, String url, {int timeout = 10}) async {
if (!isSupported) {
return -1;
}
try {
if (Platform.isIOS || Platform.isMacOS) {
return await _iosEngine.pingServer(
config: config,
url: url,
timeout: timeout,
);
} else if (Platform.isAndroid) {
return await _androidEngine.pingServer(
config: config,
url: url,
timeout: timeout,
);
}
return -1;
} catch (e) {
print('LibXray ping error: $e');
return -1;
}
}