| Index: services/dart/test/pingpong_target/main.dart
|
| diff --git a/services/dart/test/pingpong_target/main.dart b/services/dart/test/pingpong_target/main.dart
|
| index 5500322d69dab55ef456eeb011f1a7f801a38c12..34d987a2ea190fb90b0f95e0a13736564e8f61ef 100644
|
| --- a/services/dart/test/pingpong_target/main.dart
|
| +++ b/services/dart/test/pingpong_target/main.dart
|
| @@ -10,15 +10,14 @@ import 'mojo:core';
|
| import 'package:services/dart/test/pingpong_service.mojom.dart';
|
|
|
| class PingPongServiceImpl implements PingPongService {
|
| - PingPongServiceStub _stub;
|
| + PingPongServiceBinding _binding;
|
| Application _application;
|
| PingPongClientProxy _pingPongClient;
|
|
|
| PingPongServiceImpl(Application application, MojoMessagePipeEndpoint endpoint)
|
| : _application = application {
|
| - _stub = new PingPongServiceStub.fromEndpoint(endpoint)
|
| - ..delegate = this
|
| - ..listen();
|
| + _binding = new PingPongServiceBinding.fromEndpoint(
|
| + endpoint, delegate: this);
|
| }
|
|
|
| void setClient(ProxyBase proxyBase) {
|
| @@ -33,20 +32,20 @@ class PingPongServiceImpl implements PingPongService {
|
| _pingPongClient.close();
|
| _pingPongClient = null;
|
| }
|
| - _stub.close();
|
| - if (_application != null) {
|
| - _application.close();
|
| - }
|
| + _binding.close();
|
| }
|
| }
|
|
|
| class PingPongApplication extends Application {
|
| PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
|
|
|
| - void acceptConnection(String requestorUrl, ApplicationConnection connection) {
|
| + void acceptConnection(String requestorUrl,
|
| + ApplicationConnection connection,
|
| + String resolvedUrl) {
|
| connection.provideService(PingPongServiceName,
|
| (endpoint) => new PingPongServiceImpl(this, endpoint));
|
| - connection.listen();
|
| + // Close the application when the first connection goes down.
|
| + connection.listen(onClosed: close);
|
| }
|
| }
|
|
|
|
|