Index: pkg/analysis_server/lib/src/channel/byte_stream_channel.dart |
diff --git a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart |
index 730f4ec55cc76d773ceb95512b4d4458216ec52f..b10aa1b3c62e1ae979c6fe1677be05ef1e4c8118 100644 |
--- a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart |
+++ b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart |
@@ -27,19 +27,18 @@ class ByteStreamClientChannel implements ClientCommunicationChannel { |
Stream<Notification> notificationStream; |
ByteStreamClientChannel(this.input, this.output) { |
- Stream jsonStream = input.transform((new Utf8Codec()).decoder) |
- .transform(new LineSplitter()) |
- .transform(new JsonStreamDecoder()) |
- .where((json) => json is Map) |
- .asBroadcastStream(); |
- responseStream = jsonStream |
- .where((json) => json[Notification.EVENT] == null) |
- .transform(new ResponseConverter()) |
- .asBroadcastStream(); |
- notificationStream = jsonStream |
- .where((json) => json[Notification.EVENT] != null) |
- .transform(new NotificationConverter()) |
- .asBroadcastStream(); |
+ Stream jsonStream = input.transform( |
+ (new Utf8Codec()).decoder).transform( |
+ new LineSplitter()).transform( |
+ new JsonStreamDecoder()).where((json) => json is Map).asBroadcastStream(); |
+ responseStream = jsonStream.where( |
+ (json) => |
+ json[Notification.EVENT] == |
+ null).transform(new ResponseConverter()).asBroadcastStream(); |
+ notificationStream = jsonStream.where( |
+ (json) => |
+ json[Notification.EVENT] != |
+ null).transform(new NotificationConverter()).asBroadcastStream(); |
} |
@override |
@@ -90,9 +89,12 @@ class ByteStreamServerChannel implements ServerCommunicationChannel { |
@override |
void listen(void onRequest(Request request), {Function onError, void |
onDone()}) { |
- input.transform((new Utf8Codec()).decoder).transform(new LineSplitter() |
- ).listen((String data) => _readRequest(data, onRequest), onError: onError, |
- onDone: () { |
+ input.transform( |
+ (new Utf8Codec()).decoder).transform( |
+ new LineSplitter()).listen( |
+ (String data) => _readRequest(data, onRequest), |
+ onError: onError, |
+ onDone: () { |
close(); |
onDone(); |
}); |