| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 factory _ServerSocket { | 5 interface ServerSocket factory _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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 * buffer after buffer offset [offset]. The number of successfully read | 55 * buffer after buffer offset [offset]. The number of successfully read |
| 56 * bytes is returned. This function is non-blocking and will only read data | 56 * bytes is returned. This function is non-blocking and will only read data |
| 57 * if data is available. | 57 * if data is available. |
| 58 */ | 58 */ |
| 59 int readList(List<int> buffer, int offset, int count); | 59 int readList(List<int> buffer, int offset, int count); |
| 60 | 60 |
| 61 /* | 61 /* |
| 62 * Writes up to [count] bytes of the buffer from [offset] buffer offset to | 62 * Writes up to [count] bytes of the buffer from [offset] buffer offset to |
| 63 * the socket. The number of successfully written bytes is returned. This | 63 * the socket. The number of successfully written bytes is returned. This |
| 64 * function is non-blocking and will only write data if buffer space is | 64 * function is non-blocking and will only write data if buffer space is |
| 65 * available in the socket. It will return 0 if an error occurs, e.g., no | 65 * available in the socket. |
| 66 * buffer space available. | |
| 67 */ | 66 */ |
| 68 int writeList(List<int> buffer, int offset, int count); | 67 int writeList(List<int> buffer, int offset, int count); |
| 69 | 68 |
| 70 /* | 69 /* |
| 71 * The connect handler gets called when connection to a given host | 70 * The connect handler gets called when connection to a given host |
| 72 * succeeded. | 71 * succeeded. |
| 73 */ | 72 */ |
| 74 void set connectHandler(void callback()); | 73 void set connectHandler(void callback()); |
| 75 | 74 |
| 76 /* | 75 /* |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 123 |
| 125 class SocketIOException implements Exception { | 124 class SocketIOException implements Exception { |
| 126 const SocketIOException([String this.message = ""]); | 125 const SocketIOException([String this.message = ""]); |
| 127 String toString() => "SocketIOException: $message"; | 126 String toString() => "SocketIOException: $message"; |
| 128 | 127 |
| 129 /* | 128 /* |
| 130 * Contains the exception message. | 129 * Contains the exception message. |
| 131 */ | 130 */ |
| 132 final String message; | 131 final String message; |
| 133 } | 132 } |
| OLD | NEW |