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

Side by Side Diff: pkg/mdns/lib/mdns.dart

Issue 1430433005: Minor fixes to the mDNS package (Closed) Base URL: git@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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/mdns/lib/src/native_protocol_client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library mdns; 5 library mdns;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:typed_data'; 10 import 'dart:typed_data';
11 11
12 import 'package:mdns/src/native_extension_client.dart'; 12 import 'package:mdns/src/native_extension_client.dart';
13 import 'package:mdns/src/native_protocol_client.dart'; 13 import 'package:mdns/src/native_protocol_client.dart';
14 import 'package:mdns/src/constants.dart'; 14 import 'package:mdns/src/constants.dart';
15 15
16 export 'package:mdns/src/constants.dart' show RRType; 16 export 'package:mdns/src/constants.dart' show RRType;
17 export 'package:mdns/src/packet.dart' show ResourceRecord;
17 18
18 /// Client for DNS lookup using the mDNS protocol. 19 /// Client for DNS lookup using the mDNS protocol.
19 /// 20 ///
20 /// This client only support "One-Shot Multicast DNS Queries" as described in 21 /// This client only support "One-Shot Multicast DNS Queries" as described in
21 /// section 5.1 of https://tools.ietf.org/html/rfc6762 22 /// section 5.1 of https://tools.ietf.org/html/rfc6762
22 abstract class MDnsClient { 23 abstract class MDnsClient {
23 // Instantiate Client for DNS lookup using the mDNS protocol. 24 // Instantiate Client for DNS lookup using the mDNS protocol.
24 // 25 //
25 // On Mac OS a native extension is used as the mDNSResponder opens the mDNS 26 // On Mac OS a native extension is used as the mDNSResponder opens the mDNS
26 // port in exclusive mode. To test the protocol implementation on Mac OS 27 // port in exclusive mode. To test the protocol implementation on Mac OS
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 61 }
61 62
62 // Simple standalone test. 63 // Simple standalone test.
63 Future main(List<String> args) async { 64 Future main(List<String> args) async {
64 var client = new MDnsClient(); 65 var client = new MDnsClient();
65 await client.start(); 66 await client.start();
66 ResourceRecord resource = await client.lookup(RRType.A, args[0]).first; 67 ResourceRecord resource = await client.lookup(RRType.A, args[0]).first;
67 print(address); 68 print(address);
68 client.stop(); 69 client.stop();
69 } 70 }
OLDNEW
« no previous file with comments | « no previous file | pkg/mdns/lib/src/native_protocol_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698