Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: runtime/bin/tls_socket.dart

Issue 10704159: Start adding TLS (SSL) sockets to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add tls_socket.dart back. This should not be compared to socket.dart. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/tls_socket.dart
diff --git a/runtime/bin/socket.dart b/runtime/bin/tls_socket.dart
similarity index 61%
copy from runtime/bin/socket.dart
copy to runtime/bin/tls_socket.dart
index e26694d0b5ea03deaf0acdddea08efbabaf1a959..578d4159199cb21662dc02208062125721420561 100644
--- a/runtime/bin/socket.dart
+++ b/runtime/bin/tls_socket.dart
@@ -2,43 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-interface ServerSocket default _ServerSocket {
+interface TlsSocket extends Socket, Hashable default _TlsSocket {
/**
- * Constructs a new server socket, binds it to a given address and port,
- * and listens on it.
- */
- ServerSocket(String bindAddress, int port, int backlog);
-
- /**
- * The connection handler gets called when there is a new incoming
- * connection on the socket.
- */
- void set onConnection(void callback(Socket connection));
-
- /**
- * The error handler gets called when a socket error occurs.
- */
- void set onError(void callback(e));
-
- /**
- * Returns the port used by this socket.
- */
- int get port();
-
- /**
- * Closes the socket.
- */
- void close();
-}
-
-
-interface Socket extends Hashable default _Socket {
- /**
- * Constructs a new socket and initiate connecting it to the given
+ * Constructs a new secure socket and connect it to the given
* host on the given port. The returned socket is not yet connected
* but ready for registration of callbacks.
*/
- Socket(String host, int port);
+ TlsSocket(String host, int port);
Søren Gjesse 2012/07/31 09:07:15 As TlsSocket extends Socket is there any need to d
Bill Hesse 2012/08/08 17:00:05 No there is not. Fixed.
/**
* Returns the number of received and non-read bytes in the socket that
@@ -74,10 +44,8 @@ interface Socket extends Hashable default _Socket {
void set onData(void callback());
/**
- * The write handler gets called once when the socket becomes
- * available for writing. Then the handler is automatically reset to null.
- * This handler is mainly used when writeList has reported an incomplete
- * write, to schedule writing the remaining data to the socket.
+ * The write handler gets called when the socket becomes available for
+ * writing.
*/
void set onWrite(void callback());
@@ -95,11 +63,13 @@ interface Socket extends Hashable default _Socket {
/**
* Returns input stream to the socket.
+ * Not yet implemented.
*/
InputStream get inputStream();
/**
* Returns output stream of the socket.
+ * Not yet implemented.
*/
OutputStream get outputStream();
@@ -125,31 +95,10 @@ interface Socket extends Hashable default _Socket {
* possible to read data. Calling [close] will not trigger a call to
* [onClosed].
*/
- void close([bool halfClose]);
+ void close([bool halfClose = false]);
/**
* Socket is hashable.
*/
int hashCode();
}
-
-
-class SocketIOException implements Exception {
- const SocketIOException([String this.message = "",
- OSError this.osError = null]);
- String toString() {
- StringBuffer sb = new StringBuffer();
- sb.add("SocketIOException");
- if (!message.isEmpty()) {
- sb.add(": $message");
- if (osError != null) {
- sb.add(" ($osError)");
- }
- } else if (osError != null) {
- sb.add(": $osError");
- }
- return sb.toString();
- }
- final String message;
- final OSError osError;
-}

Powered by Google App Engine
This is Rietveld 408576698