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

Unified Diff: samples/chat/chat_stress_client.dart

Issue 9500002: Rename blahHandler to onBlah throughout dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 10 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
« no previous file with comments | « samples/chat/chat_server_lib.dart ('k') | samples/tests/samples/src/chat/ChatServerTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/chat/chat_stress_client.dart
diff --git a/samples/chat/chat_stress_client.dart b/samples/chat/chat_stress_client.dart
index c5c156703f343874e4e4c3f5829d5d9d72bbfd8f..0a50738db514a3eee32e8c380e3d0764a1e30e6a 100644
--- a/samples/chat/chat_stress_client.dart
+++ b/samples/chat/chat_stress_client.dart
@@ -55,15 +55,15 @@ class ChatStressClient {
leaveRequest["request"] = "leave";
leaveRequest["sessionId"] = sessionId;
HttpClientConnection conn = httpClient.post("127.0.0.1", port, "/leave");
- conn.requestHandler = (HttpClientRequest request) {
+ conn.onRequest = (HttpClientRequest request) {
request.writeString(JSON.stringify(leaveRequest));
request.outputStream.close();
};
- conn.responseHandler = (HttpClientResponse response) {
+ conn.onResponse = (HttpClientResponse response) {
StringInputStream stream = new StringInputStream(response.inputStream);
StringBuffer body = new StringBuffer();
- stream.dataHandler = () => body.add(stream.read());
- stream.closeHandler = () {
+ stream.onData = () => body.add(stream.read());
+ stream.onClosed = () {
leaveResponseHandler(response, body.toString());
};
};
@@ -85,15 +85,15 @@ class ChatStressClient {
messageRequest["nextMessage"] = receiveMessageCount;
messageRequest["maxMessages"] = 100;
HttpClientConnection conn = httpClient.post("127.0.0.1", port, "/receive");
- conn.requestHandler = (HttpClientRequest request) {
+ conn.onRequest = (HttpClientRequest request) {
request.writeString(JSON.stringify(messageRequest));
request.outputStream.close();
};
- conn.responseHandler = (HttpClientResponse response) {
+ conn.onResponse = (HttpClientResponse response) {
StringInputStream stream = new StringInputStream(response.inputStream);
StringBuffer body = new StringBuffer();
- stream.dataHandler = () => body.add(stream.read());
- stream.closeHandler = () {
+ stream.onData = () => body.add(stream.read());
+ stream.onClosed = () {
receiveResponseHandler(response, body.toString());
};
};
@@ -122,15 +122,15 @@ class ChatStressClient {
messageRequest["sessionId"] = sessionId;
messageRequest["message"] = "message " + sendMessageCount;
HttpClientConnection conn = httpClient.post("127.0.0.1", port, "/message");
- conn.requestHandler = (HttpClientRequest request) {
+ conn.onRequest = (HttpClientRequest request) {
request.writeString(JSON.stringify(messageRequest));
request.outputStream.close();
};
- conn.responseHandler = (HttpClientResponse response) {
+ conn.onResponse = (HttpClientResponse response) {
StringInputStream stream = new StringInputStream(response.inputStream);
StringBuffer body = new StringBuffer();
- stream.dataHandler = () => body.add(stream.read());
- stream.closeHandler = () {
+ stream.onData = () => body.add(stream.read());
+ stream.onClosed = () {
sendResponseHandler(response, body.toString());
};
};
@@ -152,15 +152,15 @@ class ChatStressClient {
joinRequest["request"] = "join";
joinRequest["handle"] = "test1";
HttpClientConnection conn = httpClient.post("127.0.0.1", port, "/join");
- conn.requestHandler = (HttpClientRequest request) {
+ conn.onRequest = (HttpClientRequest request) {
request.writeString(JSON.stringify(joinRequest));
request.outputStream.close();
};
- conn.responseHandler = (HttpClientResponse response) {
+ conn.onResponse = (HttpClientResponse response) {
StringInputStream stream = new StringInputStream(response.inputStream);
StringBuffer body = new StringBuffer();
- stream.dataHandler = () => body.add(stream.read());
- stream.closeHandler = () {
+ stream.onData = () => body.add(stream.read());
+ stream.onClosed = () {
joinResponseHandler(response, body.toString());
};
};
« no previous file with comments | « samples/chat/chat_server_lib.dart ('k') | samples/tests/samples/src/chat/ChatServerTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698