| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 patch class RawServerSocket { | 5 patch class RawServerSocket { |
| 6 /* patch */ static Future<RawServerSocket> bind(address, | 6 /* patch */ static Future<RawServerSocket> bind(address, |
| 7 int port, | 7 int port, |
| 8 {int backlog: 0, | 8 {int backlog: 0, |
| 9 bool v6Only: false}) { | 9 bool v6Only: false}) { |
| 10 return _RawServerSocket.bind(address, port, backlog, v6Only); | 10 return _RawServerSocket.bind(address, port, backlog, v6Only); |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 if (socket._raw != null) { | 1338 if (socket._raw != null) { |
| 1339 subscription = stream.listen( | 1339 subscription = stream.listen( |
| 1340 (data) { | 1340 (data) { |
| 1341 assert(!paused); | 1341 assert(!paused); |
| 1342 assert(buffer == null); | 1342 assert(buffer == null); |
| 1343 buffer = data; | 1343 buffer = data; |
| 1344 offset = 0; | 1344 offset = 0; |
| 1345 try { | 1345 try { |
| 1346 write(); | 1346 write(); |
| 1347 } catch (e) { | 1347 } catch (e) { |
| 1348 socket.destroy(); |
| 1348 stop(); | 1349 stop(); |
| 1349 socket._consumerDone(); | |
| 1350 done(e); | 1350 done(e); |
| 1351 } | 1351 } |
| 1352 }, | 1352 }, |
| 1353 onError: (error, [stackTrace]) { | 1353 onError: (error, [stackTrace]) { |
| 1354 socket._consumerDone(); | 1354 socket.destroy(); |
| 1355 done(error, stackTrace); | 1355 done(error, stackTrace); |
| 1356 }, | 1356 }, |
| 1357 onDone: () { | 1357 onDone: () { |
| 1358 done(); | 1358 done(); |
| 1359 }, | 1359 }, |
| 1360 cancelOnError: true); | 1360 cancelOnError: true); |
| 1361 } | 1361 } |
| 1362 return streamCompleter.future; | 1362 return streamCompleter.future; |
| 1363 } | 1363 } |
| 1364 | 1364 |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 String address, | 1754 String address, |
| 1755 List<int> in_addr, | 1755 List<int> in_addr, |
| 1756 int port) { | 1756 int port) { |
| 1757 return new Datagram( | 1757 return new Datagram( |
| 1758 data, | 1758 data, |
| 1759 new _InternetAddress(address, null, in_addr), | 1759 new _InternetAddress(address, null, in_addr), |
| 1760 port); | 1760 port); |
| 1761 } | 1761 } |
| 1762 | 1762 |
| 1763 String _socketsStats() => _SocketsObservatory.toJSON(); | 1763 String _socketsStats() => _SocketsObservatory.toJSON(); |
| OLD | NEW |