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

Unified Diff: tests/standalone/src/EchoServerTest.dart

Issue 8437090: Change the handling of closing sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments by ager@ Created 9 years, 1 month 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
« no previous file with comments | « tests/standalone/src/EchoServerStreamTest.dart ('k') | tests/standalone/src/ProcessStderrTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/EchoServerTest.dart
diff --git a/tests/standalone/src/EchoServerTest.dart b/tests/standalone/src/EchoServerTest.dart
index 51d5e32b78b11832c34f82730b3c04dca5a831c9..4e53729815f8810919a647ca154db00cd5c9636c 100644
--- a/tests/standalone/src/EchoServerTest.dart
+++ b/tests/standalone/src/EchoServerTest.dart
@@ -23,7 +23,7 @@ class EchoServerGame {
static final MSGSIZE = 10;
static final SERVERINIT = 0;
static final SERVERSHUTDOWN = -1;
- static final MESSAGES = 200;
+ static final MESSAGES = 100;
static final FIRSTCHAR = 65;
EchoServerGame.start()
@@ -75,13 +75,8 @@ class EchoServerGame {
handleRead();
}
- void closeHandler() {
- _socket.close();
- }
-
void errorHandler() {
- print("Socket error");
- _socket.close();
+ Expect.fail("Socket error");
}
void connectHandler() {
@@ -101,7 +96,6 @@ class EchoServerGame {
}
_socket.dataHandler = messageHandler;
- _socket.closeHandler = closeHandler;
_socket.errorHandler = errorHandler;
writeMessage();
}
@@ -110,7 +104,7 @@ class EchoServerGame {
if (_socket !== null) {
_socket.connectHandler = connectHandler;
} else {
- Expect.fail("socket creation failed");
+ Expect.fail("Socket creation failed");
}
}
@@ -176,6 +170,8 @@ class EchoServer extends Isolate {
bytesWritten += written;
if (bytesWritten < msgSize) {
_client.writeHandler = handleWrite;
+ } else {
+ _client.close(true);
}
}
handleWrite();
@@ -193,8 +189,7 @@ class EchoServer extends Isolate {
}
void errorHandler() {
- print("Socket error");
- _client.close();
+ Expect.fail("Socket error");
}
_client = _server.accept();
@@ -204,8 +199,7 @@ class EchoServer extends Isolate {
}
void errorHandlerServer() {
- print("Server socket error");
- _server.close();
+ Expect.fail("Server socket error");
}
this.port.receive((message, SendPort replyTo) {
« no previous file with comments | « tests/standalone/src/EchoServerStreamTest.dart ('k') | tests/standalone/src/ProcessStderrTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698