send method
Sends the given measurement to the server.
Implementation
@override
Future send(String name, String value, DateTime time) {
var timeInSeconds =
time.millisecondsSinceEpoch ~/ Duration.millisecondsPerSecond;
sanitize(String s) => s.replaceAll(RegExp(r'\s+'), '-');
if (!isConnected) connect();
return _socket!.then((sock) {
sock.writeln('${sanitize(name)} ${sanitize(value)} $timeInSeconds');
_failures = 0;
}).catchError((_) {
_failures++;
});
}