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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 void writeCharCode(int charCode) => _sink.writeCharCode(charCode); | 1084 void writeCharCode(int charCode) => _sink.writeCharCode(charCode); |
1085 | 1085 |
1086 void writeAll(Iterable objects, [sep = ""]) => _sink.writeAll(objects, sep); | 1086 void writeAll(Iterable objects, [sep = ""]) => _sink.writeAll(objects, sep); |
1087 | 1087 |
1088 void add(List<int> bytes) => _sink.add(bytes); | 1088 void add(List<int> bytes) => _sink.add(bytes); |
1089 | 1089 |
1090 Future<Socket> addStream(Stream<List<int>> stream) { | 1090 Future<Socket> addStream(Stream<List<int>> stream) { |
1091 return _sink.addStream(stream); | 1091 return _sink.addStream(stream); |
1092 } | 1092 } |
1093 | 1093 |
| 1094 Future<Socket> flush() => _sink.flush(); |
| 1095 |
1094 Future<Socket> close() => _sink.close(); | 1096 Future<Socket> close() => _sink.close(); |
1095 | 1097 |
1096 Future<Socket> get done => _sink.done; | 1098 Future<Socket> get done => _sink.done; |
1097 | 1099 |
1098 void destroy() { | 1100 void destroy() { |
1099 // Destroy can always be called to get rid of a socket. | 1101 // Destroy can always be called to get rid of a socket. |
1100 if (_raw == null) return; | 1102 if (_raw == null) return; |
1101 _consumer.stop(); | 1103 _consumer.stop(); |
1102 _closeRawSocket(); | 1104 _closeRawSocket(); |
1103 _controllerClosed = true; | 1105 _controllerClosed = true; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 if (_detachReady != null) { | 1216 if (_detachReady != null) { |
1215 _detachReady.complete(null); | 1217 _detachReady.complete(null); |
1216 } else { | 1218 } else { |
1217 if (_raw != null) { | 1219 if (_raw != null) { |
1218 _raw.shutdown(SocketDirection.SEND); | 1220 _raw.shutdown(SocketDirection.SEND); |
1219 _disableWriteEvent(); | 1221 _disableWriteEvent(); |
1220 } | 1222 } |
1221 } | 1223 } |
1222 } | 1224 } |
1223 } | 1225 } |
OLD | NEW |