| 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 interface ServerSocket default _ServerSocket { | 5 interface ServerSocket default _ServerSocket { |
| 6 /** | 6 /** |
| 7 * Constructs a new server socket, binds it to a given address and port, | 7 * Constructs a new server socket, binds it to a given address and port, |
| 8 * and listens on it. | 8 * and listens on it. |
| 9 */ | 9 */ |
| 10 ServerSocket(String bindAddress, int port, int backlog); | 10 ServerSocket(String bindAddress, int port, int backlog); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 int get port(); | 26 int get port(); |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * Closes the socket. | 29 * Closes the socket. |
| 30 */ | 30 */ |
| 31 void close(); | 31 void close(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 | 34 |
| 35 interface Socket default _Socket { | 35 interface Socket extends Hashable default _Socket { |
| 36 /** | 36 /** |
| 37 * Constructs a new socket and connects it to the given host on the given | 37 * Constructs a new socket and connects it to the given host on the given |
| 38 * port. | 38 * port. |
| 39 */ | 39 */ |
| 40 Socket(String host, int port); | 40 Socket(String host, int port); |
| 41 | 41 |
| 42 /** | 42 /** |
| 43 * Returns the number of received and non-read bytes in the socket that | 43 * Returns the number of received and non-read bytes in the socket that |
| 44 * can be read. | 44 * can be read. |
| 45 */ | 45 */ |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 int get port(); | 106 int get port(); |
| 107 | 107 |
| 108 /** | 108 /** |
| 109 * Closes the socket. Calling [close] will never throw an exception | 109 * Closes the socket. Calling [close] will never throw an exception |
| 110 * and calling it several times is supported. If [halfClose] is true | 110 * and calling it several times is supported. If [halfClose] is true |
| 111 * the socket will only be closed for writing and it might still be | 111 * the socket will only be closed for writing and it might still be |
| 112 * possible to read data. Calling [close] will not trigger a call to | 112 * possible to read data. Calling [close] will not trigger a call to |
| 113 * [onClosed]. | 113 * [onClosed]. |
| 114 */ | 114 */ |
| 115 void close([bool halfClose]); | 115 void close([bool halfClose]); |
| 116 |
| 117 /** |
| 118 * Socket is hashable. |
| 119 */ |
| 120 int hashCode(); |
| 116 } | 121 } |
| 117 | 122 |
| 118 | 123 |
| 119 class SocketIOException implements Exception { | 124 class SocketIOException implements Exception { |
| 120 const SocketIOException([String this.message = ""]); | 125 const SocketIOException([String this.message = ""]); |
| 121 String toString() => "SocketIOException: $message"; | 126 String toString() => "SocketIOException: $message"; |
| 122 final String message; | 127 final String message; |
| 123 } | 128 } |
| OLD | NEW |