send abort to close test connection
This commit is contained in:
parent
f0d4d9d75a
commit
6e066d43c2
2 changed files with 7 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
|||
package org.capnproto;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface VatNetwork<VatId>
|
||||
|
|
|
@ -33,10 +33,11 @@ import java.util.concurrent.CompletableFuture;
|
|||
import java.util.concurrent.CompletionException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import static org.capnproto.RpcState.FromException;
|
||||
|
||||
public class RpcTest {
|
||||
|
||||
final class TestNetwork {
|
||||
static final class TestNetwork {
|
||||
|
||||
final Map<String, TestNetworkAdapter> map = new HashMap<>();
|
||||
int received = 0;
|
||||
|
@ -51,7 +52,7 @@ public class RpcTest {
|
|||
}
|
||||
}
|
||||
|
||||
final class TestNetworkAdapter
|
||||
static final class TestNetworkAdapter
|
||||
implements VatNetwork<Test.TestSturdyRef.Reader> {
|
||||
|
||||
@Override
|
||||
|
@ -169,6 +170,10 @@ public class RpcTest {
|
|||
|
||||
@Override
|
||||
public void close() {
|
||||
var msg = newOutgoingMessage(0);
|
||||
var abort = msg.getBody().initAs(RpcProtocol.Message.factory).initAbort();
|
||||
FromException(RpcException.disconnected(""), abort);
|
||||
msg.send();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue