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

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

Issue 1436663002: Avoid a warning due to bug in Dart SDK (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 | no next file » | 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.src.native_protocol_client; 5 library mdns.src.native_protocol_client;
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 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // Find all network interfaces with an IPv4 address. 94 // Find all network interfaces with an IPv4 address.
95 var interfaces = 95 var interfaces =
96 await NetworkInterface.list(type: InternetAddressType.IP_V4); 96 await NetworkInterface.list(type: InternetAddressType.IP_V4);
97 for (NetworkInterface interface in interfaces) { 97 for (NetworkInterface interface in interfaces) {
98 // Create a socket for sending on each adapter. 98 // Create a socket for sending on each adapter.
99 var socket = await RawDatagramSocket.bind( 99 var socket = await RawDatagramSocket.bind(
100 interface.addresses[0], mDnsPort, reuseAddress: true); 100 interface.addresses[0], mDnsPort, reuseAddress: true);
101 _sockets.add(socket); 101 _sockets.add(socket);
102 102
103 // Join multicast on this interface. 103 // Join multicast on this interface.
104 _incoming.joinMulticast(mDnsAddress, interface); 104 (_incoming as dynamic).joinMulticast(mDnsAddress, interface);
105 } 105 }
106 _incoming.listen(_handleIncoming); 106 _incoming.listen(_handleIncoming);
107 107
108 _starting = false; 108 _starting = false;
109 _started = true; 109 _started = true;
110 } 110 }
111 111
112 void stop() { 112 void stop() {
113 if (!_started) return; 113 if (!_started) return;
114 if (_starting) { 114 if (_starting) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (event == RawSocketEvent.READ) { 158 if (event == RawSocketEvent.READ) {
159 Datagram datagram = _incoming.receive(); 159 Datagram datagram = _incoming.receive();
160 List<ResourceRecord> response = decodeMDnsResponse(datagram.data); 160 List<ResourceRecord> response = decodeMDnsResponse(datagram.data);
161 if (response != null) { 161 if (response != null) {
162 cache.updateRecords(response); 162 cache.updateRecords(response);
163 _resolver.handleResponse(response); 163 _resolver.handleResponse(response);
164 } 164 }
165 } 165 }
166 } 166 }
167 } 167 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698