OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * The [SecureServerSocket] is a server socket, providing a stream of high-level | 8 * The [SecureServerSocket] is a server socket, providing a stream of high-level |
9 * [Socket]s. | 9 * [Socket]s. |
10 * | 10 * |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 * was received, the result will be null. | 60 * was received, the result will be null. |
61 */ | 61 */ |
62 static Future<SecureServerSocket> bind( | 62 static Future<SecureServerSocket> bind( |
63 address, | 63 address, |
64 int port, | 64 int port, |
65 String certificateName, | 65 String certificateName, |
66 {int backlog: 0, | 66 {int backlog: 0, |
67 bool v6Only: false, | 67 bool v6Only: false, |
68 bool requestClientCertificate: false, | 68 bool requestClientCertificate: false, |
69 bool requireClientCertificate: false, | 69 bool requireClientCertificate: false, |
70 List<String> supportedProtocols}) { | 70 List<String> supportedProtocols, |
| 71 bool shared: false}) { |
71 return RawSecureServerSocket.bind( | 72 return RawSecureServerSocket.bind( |
72 address, | 73 address, |
73 port, | 74 port, |
74 certificateName, | 75 certificateName, |
75 backlog: backlog, | 76 backlog: backlog, |
76 v6Only: v6Only, | 77 v6Only: v6Only, |
77 requestClientCertificate: requestClientCertificate, | 78 requestClientCertificate: requestClientCertificate, |
78 requireClientCertificate: requireClientCertificate, | 79 requireClientCertificate: requireClientCertificate, |
79 supportedProtocols: supportedProtocols).then( | 80 supportedProtocols: supportedProtocols, |
| 81 shared: shared).then( |
80 (serverSocket) => new SecureServerSocket._(serverSocket)); | 82 (serverSocket) => new SecureServerSocket._(serverSocket)); |
81 } | 83 } |
82 | 84 |
83 StreamSubscription<SecureSocket> listen(void onData(SecureSocket socket), | 85 StreamSubscription<SecureSocket> listen(void onData(SecureSocket socket), |
84 {Function onError, | 86 {Function onError, |
85 void onDone(), | 87 void onDone(), |
86 bool cancelOnError}) { | 88 bool cancelOnError}) { |
87 return _socket.map((rawSocket) => new SecureSocket._(rawSocket)) | 89 return _socket.map((rawSocket) => new SecureSocket._(rawSocket)) |
88 .listen(onData, | 90 .listen(onData, |
89 onError: onError, | 91 onError: onError, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 * was received, the result will be null. | 187 * was received, the result will be null. |
186 */ | 188 */ |
187 static Future<RawSecureServerSocket> bind( | 189 static Future<RawSecureServerSocket> bind( |
188 address, | 190 address, |
189 int port, | 191 int port, |
190 String certificateName, | 192 String certificateName, |
191 {int backlog: 0, | 193 {int backlog: 0, |
192 bool v6Only: false, | 194 bool v6Only: false, |
193 bool requestClientCertificate: false, | 195 bool requestClientCertificate: false, |
194 bool requireClientCertificate: false, | 196 bool requireClientCertificate: false, |
195 List<String> supportedProtocols}) { | 197 List<String> supportedProtocols, |
196 return RawServerSocket.bind(address, port, backlog: backlog, v6Only: v6Only) | 198 bool shared: false}) { |
| 199 return RawServerSocket.bind( |
| 200 address, port, backlog: backlog, v6Only: v6Only, shared: shared) |
197 .then((serverSocket) => new RawSecureServerSocket._( | 201 .then((serverSocket) => new RawSecureServerSocket._( |
198 serverSocket, | 202 serverSocket, |
199 certificateName, | 203 certificateName, |
200 requestClientCertificate, | 204 requestClientCertificate, |
201 requireClientCertificate, | 205 requireClientCertificate, |
202 supportedProtocols)); | 206 supportedProtocols)); |
203 } | 207 } |
204 | 208 |
205 StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s), | 209 StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s), |
206 {Function onError, | 210 {Function onError, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 onError: _onError); | 289 onError: _onError); |
286 } else { | 290 } else { |
287 close(); | 291 close(); |
288 } | 292 } |
289 } | 293 } |
290 | 294 |
291 void set _owner(owner) { (_socket as dynamic)._owner = owner; } | 295 void set _owner(owner) { (_socket as dynamic)._owner = owner; } |
292 } | 296 } |
293 | 297 |
294 | 298 |
OLD | NEW |