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

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

Issue 8726031: Change handling of accepting socket connections (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « samples/chat/http_impl.dart ('k') | tests/standalone/src/EchoServerTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/EchoServerStreamTest.dart
diff --git a/tests/standalone/src/EchoServerStreamTest.dart b/tests/standalone/src/EchoServerStreamTest.dart
index 66ea572bdb27b8ec4a8789fd138d181efe2406c0..f3506c0ef4e18a352383a8c6d2a7098a096732f5 100644
--- a/tests/standalone/src/EchoServerStreamTest.dart
+++ b/tests/standalone/src/EchoServerStreamTest.dart
@@ -139,8 +139,7 @@ class EchoServer extends TestingServer {
static final int MSGSIZE = EchoServerGame.MSGSIZE;
- void connectionHandler() {
- Socket _client;
+ void connectionHandler(Socket connection) {
InputStream inputStream;
List<int> buffer = new List<int>(MSGSIZE);
int offset = 0;
@@ -148,7 +147,7 @@ class EchoServer extends TestingServer {
void dataReceived() {
SocketOutputStream outputStream;
int bytesRead;
- outputStream = _client.outputStream;
+ outputStream = connection.outputStream;
bytesRead = inputStream.readInto(buffer, offset, MSGSIZE - offset);
if (bytesRead > 0) {
offset += bytesRead;
@@ -166,10 +165,9 @@ class EchoServer extends TestingServer {
Expect.fail("Socket error");
}
- _client = _server.accept();
- inputStream = _client.inputStream;
+ inputStream = connection.inputStream;
inputStream.dataHandler = dataReceived;
- _client.errorHandler = errorHandler;
+ connection.errorHandler = errorHandler;
}
}
« no previous file with comments | « samples/chat/http_impl.dart ('k') | tests/standalone/src/EchoServerTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698