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 bool shared: false}) { | 10 bool shared: false}) { |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 /* patch */ factory InternetAddress(String address) { | 41 /* patch */ factory InternetAddress(String address) { |
42 return new _InternetAddress.parse(address); | 42 return new _InternetAddress.parse(address); |
43 } | 43 } |
44 | 44 |
45 /* patch */ static Future<List<InternetAddress>> lookup( | 45 /* patch */ static Future<List<InternetAddress>> lookup( |
46 String host, {InternetAddressType type: InternetAddressType.ANY}) { | 46 String host, {InternetAddressType type: InternetAddressType.ANY}) { |
47 return _NativeSocket.lookup(host, type: type); | 47 return _NativeSocket.lookup(host, type: type); |
48 } | 48 } |
49 | |
50 /* patch */ static InternetAddress _cloneWithNewHost( | |
51 InternetAddress address, String host) { | |
52 return (address as _InternetAddress)._cloneWithNewHost(host); | |
53 } | |
54 } | 49 } |
55 | 50 |
56 patch class NetworkInterface { | 51 patch class NetworkInterface { |
57 /* patch */ static bool get listSupported { | 52 /* patch */ static bool get listSupported { |
58 return _listSupported(); | 53 return _listSupported(); |
59 } | 54 } |
60 | 55 |
61 /* patch */ static Future<List<NetworkInterface>> list({ | 56 /* patch */ static Future<List<NetworkInterface>> list({ |
62 bool includeLoopback: false, | 57 bool includeLoopback: false, |
63 bool includeLinkLocal: false, | 58 bool includeLinkLocal: false, |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 native.closedReadEventSent = true; | 1243 native.closedReadEventSent = true; |
1249 return new _RawSocket(native); | 1244 return new _RawSocket(native); |
1250 } | 1245 } |
1251 | 1246 |
1252 factory _RawSocket._readPipe(int fd) { | 1247 factory _RawSocket._readPipe(int fd) { |
1253 var native = new _NativeSocket.pipe(); | 1248 var native = new _NativeSocket.pipe(); |
1254 native.isClosedWrite = true; | 1249 native.isClosedWrite = true; |
1255 if (fd != null) _getStdioHandle(native, fd); | 1250 if (fd != null) _getStdioHandle(native, fd); |
1256 var result = new _RawSocket(native); | 1251 var result = new _RawSocket(native); |
1257 if (fd != null) { | 1252 if (fd != null) { |
1258 var socketType = _StdIOUtils._nativeSocketType(result._socket); | 1253 var socketType = _StdIOUtils._socketType(result._socket); |
1259 result._isMacOSTerminalInput = | 1254 result._isMacOSTerminalInput = |
1260 Platform.isMacOS && socketType == _STDIO_HANDLE_TYPE_TERMINAL; | 1255 Platform.isMacOS && socketType == _STDIO_HANDLE_TYPE_TERMINAL; |
1261 } | 1256 } |
1262 return result; | 1257 return result; |
1263 } | 1258 } |
1264 | 1259 |
1265 StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event), | 1260 StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event), |
1266 {Function onError, | 1261 {Function onError, |
1267 void onDone(), | 1262 void onDone(), |
1268 bool cancelOnError}) { | 1263 bool cancelOnError}) { |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 Datagram _makeDatagram(List<int> data, | 1852 Datagram _makeDatagram(List<int> data, |
1858 String address, | 1853 String address, |
1859 List<int> in_addr, | 1854 List<int> in_addr, |
1860 int port) { | 1855 int port) { |
1861 return new Datagram( | 1856 return new Datagram( |
1862 data, | 1857 data, |
1863 new _InternetAddress(address, null, in_addr), | 1858 new _InternetAddress(address, null, in_addr), |
1864 port); | 1859 port); |
1865 } | 1860 } |
1866 | 1861 |
OLD | NEW |