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 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 | 7 |
8 /** | 8 /** |
9 * [InternetAddressType] is the type an [InternetAddress]. Currently, | 9 * [InternetAddressType] is the type an [InternetAddress]. Currently, |
10 * IP version 4 (IPv4) and IP version 6 (IPv6) are supported. | 10 * IP version 4 (IPv4) and IP version 6 (IPv6) are supported. |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 int port, | 195 int port, |
196 {int backlog: 0, | 196 {int backlog: 0, |
197 bool v6Only: false}); | 197 bool v6Only: false}); |
198 | 198 |
199 /** | 199 /** |
200 * Returns the port used by this socket. | 200 * Returns the port used by this socket. |
201 */ | 201 */ |
202 int get port; | 202 int get port; |
203 | 203 |
204 /** | 204 /** |
| 205 * Returns the address used by this socket. |
| 206 */ |
| 207 InternetAddress get address; |
| 208 |
| 209 /** |
205 * Closes the socket. The returned future completes when the socket | 210 * Closes the socket. The returned future completes when the socket |
206 * is fully closed and is no longer bound. | 211 * is fully closed and is no longer bound. |
207 */ | 212 */ |
208 Future<RawServerSocket> close(); | 213 Future<RawServerSocket> close(); |
209 } | 214 } |
210 | 215 |
211 | 216 |
212 /** | 217 /** |
213 * A [ServerSocket] represents a listening socket, and provides a | 218 * A [ServerSocket] represents a listening socket, and provides a |
214 * stream of [Socket] objects, one for each connection made to the | 219 * stream of [Socket] objects, one for each connection made to the |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 int port, | 256 int port, |
252 {int backlog: 0, | 257 {int backlog: 0, |
253 bool v6Only: false}); | 258 bool v6Only: false}); |
254 | 259 |
255 /** | 260 /** |
256 * Returns the port used by this socket. | 261 * Returns the port used by this socket. |
257 */ | 262 */ |
258 int get port; | 263 int get port; |
259 | 264 |
260 /** | 265 /** |
| 266 * Returns the address used by this socket. |
| 267 */ |
| 268 InternetAddress get address; |
| 269 |
| 270 /** |
261 * Closes the socket. The returned future completes when the socket | 271 * Closes the socket. The returned future completes when the socket |
262 * is fully closed and is no longer bound. | 272 * is fully closed and is no longer bound. |
263 */ | 273 */ |
264 Future<ServerSocket> close(); | 274 Future<ServerSocket> close(); |
265 } | 275 } |
266 | 276 |
267 /** | 277 /** |
268 * The [SocketDirection] is used as a parameter to [Socket.close] and | 278 * The [SocketDirection] is used as a parameter to [Socket.close] and |
269 * [RawSocket.close] to close a socket in the specified direction(s). | 279 * [RawSocket.close] to close a socket in the specified direction(s). |
270 */ | 280 */ |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 } else { | 512 } else { |
503 sb.write(", address = ${address.address}"); | 513 sb.write(", address = ${address.address}"); |
504 } | 514 } |
505 } | 515 } |
506 if (port != null) { | 516 if (port != null) { |
507 sb.write(", port = $port"); | 517 sb.write(", port = $port"); |
508 } | 518 } |
509 return sb.toString(); | 519 return sb.toString(); |
510 } | 520 } |
511 } | 521 } |
OLD | NEW |