| 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 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 native.isClosedRead = true; | 1236 native.isClosedRead = true; |
| 1237 native.closedReadEventSent = true; | 1237 native.closedReadEventSent = true; |
| 1238 return new _RawSocket(native); | 1238 return new _RawSocket(native); |
| 1239 } | 1239 } |
| 1240 | 1240 |
| 1241 factory _RawSocket._readPipe(int fd) { | 1241 factory _RawSocket._readPipe(int fd) { |
| 1242 var native = new _NativeSocket.pipe(); | 1242 var native = new _NativeSocket.pipe(); |
| 1243 native.isClosedWrite = true; | 1243 native.isClosedWrite = true; |
| 1244 if (fd != null) _getStdioHandle(native, fd); | 1244 if (fd != null) _getStdioHandle(native, fd); |
| 1245 var result = new _RawSocket(native); | 1245 var result = new _RawSocket(native); |
| 1246 result._isMacOSTerminalInput = | 1246 if (fd != null) { |
| 1247 Platform.isMacOS && | 1247 var socketType = _StdIOUtils._socketType(result._socket); |
| 1248 _StdIOUtils._socketType(result._socket) == _STDIO_HANDLE_TYPE_TERMINAL; | 1248 result._isMacOSTerminalInput = |
| 1249 Platform.isMacOS && socketType == _STDIO_HANDLE_TYPE_TERMINAL; |
| 1250 } |
| 1249 return result; | 1251 return result; |
| 1250 } | 1252 } |
| 1251 | 1253 |
| 1252 StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event), | 1254 StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event), |
| 1253 {Function onError, | 1255 {Function onError, |
| 1254 void onDone(), | 1256 void onDone(), |
| 1255 bool cancelOnError}) { | 1257 bool cancelOnError}) { |
| 1256 return _controller.stream.listen( | 1258 return _controller.stream.listen( |
| 1257 onData, | 1259 onData, |
| 1258 onError: onError, | 1260 onError: onError, |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 Datagram _makeDatagram(List<int> data, | 1846 Datagram _makeDatagram(List<int> data, |
| 1845 String address, | 1847 String address, |
| 1846 List<int> in_addr, | 1848 List<int> in_addr, |
| 1847 int port) { | 1849 int port) { |
| 1848 return new Datagram( | 1850 return new Datagram( |
| 1849 data, | 1851 data, |
| 1850 new _InternetAddress(address, null, in_addr), | 1852 new _InternetAddress(address, null, in_addr), |
| 1851 port); | 1853 port); |
| 1852 } | 1854 } |
| 1853 | 1855 |
| OLD | NEW |