serverConnected method
Return a future that completes with a bool
indicating whether
a connection was successfully established with the server.
Implementation
Future<bool> serverConnected({Duration? timeLimit}) {
var future = _connected.future;
if (timeLimit != null) {
future = future.timeout(timeLimit, onTimeout: () {
onFailedToConnect();
server.stop();
return false;
});
}
return future;
}