Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1587)

Unified Diff: pkg/mdns/lib/mdns.dart

Issue 1412063015: Improve resource record implementation in the mdns package. (Closed) Base URL: https://github.com/dart-lang/fletch.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/mdns/lib/mdns-sd.dart » ('j') | pkg/mdns/lib/mdns-sd.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/mdns/lib/mdns.dart
diff --git a/pkg/mdns/lib/mdns.dart b/pkg/mdns/lib/mdns.dart
index 55682a7b4ca2c2360d0554cb504ef3c130f4e71f..81528137a8c00b5ad6621e12062e48d5f768bb5a 100644
--- a/pkg/mdns/lib/mdns.dart
+++ b/pkg/mdns/lib/mdns.dart
@@ -11,6 +11,9 @@ import 'dart:typed_data';
import 'package:mdns/src/native_extension_client.dart';
import 'package:mdns/src/native_protocol_client.dart';
+import 'package:mdns/src/constants.dart';
+
+export 'package:mdns/src/constants.dart' show RRType;
/// Client for DNS lookup using the mDNS protocol.
///
@@ -51,15 +54,17 @@ abstract class MDnsClient {
///
/// If no answer has been received within the specified [timeout]
/// this method will complete with the value `null`.
- Future<InternetAddress> lookup(
- String hostname, {Duration timeout: const Duration(seconds: 5)});
+ Stream<ResourceRecord> lookup(
+ int type,
+ String name,
+ {Duration timeout: const Duration(seconds: 5)});
}
// Simple standalone test.
Future main(List<String> args) async {
var client = new MDnsClient();
await client.start();
- var address = await client.lookup(args[0]);
- client.stop();
+ ResourceRecord resource = await client.lookup(RRType.A, args[0]).first;
print(address);
+ client.stop();
}
« no previous file with comments | « no previous file | pkg/mdns/lib/mdns-sd.dart » ('j') | pkg/mdns/lib/mdns-sd.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698