| 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 abstract class ServerSocket { | 5 abstract class 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 factory ServerSocket(String bindAddress, int port, int backlog) { | 10 factory ServerSocket(String bindAddress, int port, int backlog) { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void close([bool halfClose = false]); | 130 void close([bool halfClose = false]); |
| 131 } | 131 } |
| 132 | 132 |
| 133 | 133 |
| 134 class SocketIOException implements Exception { | 134 class SocketIOException implements Exception { |
| 135 const SocketIOException([String this.message = "", | 135 const SocketIOException([String this.message = "", |
| 136 OSError this.osError = null]); | 136 OSError this.osError = null]); |
| 137 String toString() { | 137 String toString() { |
| 138 StringBuffer sb = new StringBuffer(); | 138 StringBuffer sb = new StringBuffer(); |
| 139 sb.add("SocketIOException"); | 139 sb.add("SocketIOException"); |
| 140 if (!message.isEmpty()) { | 140 if (!message.isEmpty) { |
| 141 sb.add(": $message"); | 141 sb.add(": $message"); |
| 142 if (osError != null) { | 142 if (osError != null) { |
| 143 sb.add(" ($osError)"); | 143 sb.add(" ($osError)"); |
| 144 } | 144 } |
| 145 } else if (osError != null) { | 145 } else if (osError != null) { |
| 146 sb.add(": $osError"); | 146 sb.add(": $osError"); |
| 147 } | 147 } |
| 148 return sb.toString(); | 148 return sb.toString(); |
| 149 } | 149 } |
| 150 final String message; | 150 final String message; |
| 151 final OSError osError; | 151 final OSError osError; |
| 152 } | 152 } |
| OLD | NEW |