WIP
Change-Id: I82493f78ecfd5b922ec4b5ac63fe2a0545806297
diff --git a/examples/distro/app/src/flutter/lib/app.dart b/examples/distro/app/src/flutter/lib/app.dart
index 526c753..e822fd3 100644
--- a/examples/distro/app/src/flutter/lib/app.dart
+++ b/examples/distro/app/src/flutter/lib/app.dart
@@ -28,6 +28,7 @@
}
final Map<String, String> devices = {};
+ final Set<String> castTargets = new Set();
Future<String> _onDeviceOnline(final String json) async {
final Map<String, dynamic> message = JSON.decode(json);
@@ -36,7 +37,10 @@
}
Future<String> _onDeviceOffline(final String name) async {
- setState(() => devices.remove(name));
+ setState(() {
+ devices.remove(name);
+ castTargets.remove(name);
+ }devices.remove(name));
if (castTargetName == name) {
terminateCast();
}
diff --git a/examples/distro/app/src/main/java/io/baku/examples/distro/DistroActivity.java b/examples/distro/app/src/main/java/io/baku/examples/distro/DistroActivity.java
index 109300f..c20d397 100644
--- a/examples/distro/app/src/main/java/io/baku/examples/distro/DistroActivity.java
+++ b/examples/distro/app/src/main/java/io/baku/examples/distro/DistroActivity.java
@@ -36,7 +36,6 @@
import io.v.v23.options.RpcOptions;
import io.v.v23.security.Blessings;
import io.v.v23.vdl.ClientStream;
-import io.v.v23.vdl.VdlAny;
import io.v.v23.verror.VException;
import io.v.v23.vom.VomUtil;
import java8.util.Maps;
@@ -170,7 +169,7 @@
private class ConnectionMonitor implements FutureCallback<String> {
public final String name;
private final DistroClient client;
- private ClientStream<State, VdlAny, Void> castStream;
+ private ClientStream<State, State, Void> castStream;
private ListenableFuture<String> poll;
private final FutureCallback<Object> castTerminated = new FutureCallback<Object>() {
diff --git a/examples/distro/app/src/main/java/io/baku/examples/distro/DistroAndroidService.java b/examples/distro/app/src/main/java/io/baku/examples/distro/DistroAndroidService.java
index 77dd1e6..b880530 100644
--- a/examples/distro/app/src/main/java/io/baku/examples/distro/DistroAndroidService.java
+++ b/examples/distro/app/src/main/java/io/baku/examples/distro/DistroAndroidService.java
@@ -122,7 +122,7 @@
@Override
public ListenableFuture<Void> cast(final VContext context, final ServerCall call,
- final ServerStream<VdlAny, State> stream) {
+ final ServerStream<State, State> stream) {
final String key = UUID.randomUUID().toString();
Log.i(TAG, "Hosting new casting session " + key);
diff --git a/examples/distro/app/src/main/java/io/baku/examples/distro/distro.vdl b/examples/distro/app/src/main/java/io/baku/examples/distro/distro.vdl
index 39f30a5..b3f0bdf 100644
--- a/examples/distro/app/src/main/java/io/baku/examples/distro/distro.vdl
+++ b/examples/distro/app/src/main/java/io/baku/examples/distro/distro.vdl
@@ -7,7 +7,6 @@
type State string
type Distro interface {
- // Right now, the server->client any stream is used as a glorified completion signal.
- Cast() stream<State, any> error
+ Cast() stream<State, State> error
GetDescription() (string | error)
}
\ No newline at end of file