mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +01:00
moved Endpoint prop. to RemoteCapability
This commit is contained in:
parent
e3b6fd5c62
commit
747d350b20
@ -16,8 +16,6 @@ namespace Capnp.Rpc
|
||||
/// </summary>
|
||||
protected abstract void ReleaseRemotely();
|
||||
internal abstract Action? Export(IRpcEndpoint endpoint, CapDescriptor.WRITER writer);
|
||||
internal abstract IRpcEndpoint? Endpoint { get; }
|
||||
|
||||
internal abstract void AddRef();
|
||||
internal abstract void Release();
|
||||
|
||||
|
@ -28,8 +28,6 @@ namespace Capnp.Rpc
|
||||
return call;
|
||||
}
|
||||
|
||||
internal override IRpcEndpoint? Endpoint => _ep;
|
||||
|
||||
internal override Action? Export(IRpcEndpoint endpoint, CapDescriptor.WRITER capDesc)
|
||||
{
|
||||
if (endpoint == _ep)
|
||||
|
@ -34,7 +34,5 @@ namespace Capnp.Rpc.Interception
|
||||
writer.SenderHosted = endpoint.AllocateExport(MyVine, out bool _);
|
||||
return null;
|
||||
}
|
||||
|
||||
internal override IRpcEndpoint? Endpoint => null;
|
||||
}
|
||||
}
|
@ -33,8 +33,6 @@ namespace Capnp.Rpc
|
||||
_capTask = AwaitCap();
|
||||
}
|
||||
|
||||
internal override IRpcEndpoint? Endpoint => null;
|
||||
|
||||
internal override Action? Export(IRpcEndpoint endpoint, CapDescriptor.WRITER writer)
|
||||
{
|
||||
if (WhenResolved.ReplacementTaskIsCompletedSuccessfully())
|
||||
|
@ -29,8 +29,6 @@ namespace Capnp.Rpc
|
||||
|
||||
}
|
||||
|
||||
internal override IRpcEndpoint? Endpoint => null;
|
||||
|
||||
public Task WhenResolved => _whenResolvedProxy;
|
||||
|
||||
public T? GetResolvedCapability<T>() where T : class => _whenResolvedProxy.GetResolvedCapability<T>();
|
||||
|
@ -52,8 +52,6 @@ namespace Capnp.Rpc
|
||||
return null;
|
||||
}
|
||||
|
||||
internal override IRpcEndpoint? Endpoint => null;
|
||||
|
||||
protected override void ReleaseRemotely()
|
||||
{
|
||||
}
|
||||
|
@ -23,8 +23,6 @@ namespace Capnp.Rpc
|
||||
public override Task WhenResolved => _resolvedCap.Task;
|
||||
public override T? GetResolvedCapability<T>() where T: class => _whenResolvedProxy.GetResolvedCapability<T>();
|
||||
|
||||
internal override IRpcEndpoint? Endpoint => _ep;
|
||||
|
||||
internal override Action? Export(IRpcEndpoint endpoint, CapDescriptor.WRITER writer)
|
||||
{
|
||||
lock (_reentrancyBlocker)
|
||||
|
@ -174,8 +174,6 @@ namespace Capnp.Rpc
|
||||
return call;
|
||||
}
|
||||
|
||||
internal override IRpcEndpoint Endpoint => _ep;
|
||||
|
||||
internal override Action? Export(IRpcEndpoint endpoint, CapDescriptor.WRITER writer)
|
||||
{
|
||||
lock (_question.ReentrancyBlocker)
|
||||
|
@ -13,6 +13,8 @@ namespace Capnp.Rpc
|
||||
_ep = ep;
|
||||
}
|
||||
|
||||
internal IRpcEndpoint Endpoint => _ep;
|
||||
|
||||
internal override IPromisedAnswer DoCall(ulong interfaceId, ushort methodId, DynamicSerializerState args)
|
||||
{
|
||||
var call = SetupMessage(args, interfaceId, methodId);
|
||||
|
@ -32,18 +32,11 @@ namespace Capnp.Rpc
|
||||
|
||||
protected IPromisedAnswer CallOnResolution(ulong interfaceId, ushort methodId, DynamicSerializerState args)
|
||||
{
|
||||
if (ResolvedCap == null)
|
||||
throw new InvalidOperationException("Capability not yet resolved, calling on resolution not possible");
|
||||
var resolvedCap = ResolvedCap!;
|
||||
|
||||
try
|
||||
{
|
||||
if (ResolvedCap.Endpoint!= null && ResolvedCap.Endpoint != _ep)
|
||||
{
|
||||
// Carol lives in a different Vat C.
|
||||
throw new NotImplementedException("Sorry, level 3 RPC is not yet supported.");
|
||||
}
|
||||
|
||||
if (ResolvedCap.Endpoint != null ||
|
||||
if (resolvedCap is RemoteCapability ||
|
||||
//# Note that in the case where Carol actually lives in Vat B (i.e., the same vat that the promise
|
||||
//# already pointed at), no embargo is needed, because the pipelined calls are delivered over the
|
||||
//# same path as the later direct calls.
|
||||
@ -58,7 +51,7 @@ namespace Capnp.Rpc
|
||||
#if DebugEmbargos
|
||||
Logger.LogDebug("Direct call");
|
||||
#endif
|
||||
using var proxy = new Proxy(ResolvedCap);
|
||||
using var proxy = new Proxy(resolvedCap);
|
||||
return proxy.Call(interfaceId, methodId, args, default);
|
||||
}
|
||||
else
|
||||
|
@ -891,7 +891,7 @@ namespace Capnp.Rpc
|
||||
{
|
||||
using var proxy = await t;
|
||||
|
||||
if (proxy.ConsumedCap?.Endpoint == this)
|
||||
if (proxy.ConsumedCap is RemoteCapability remote && remote.Endpoint == this)
|
||||
{
|
||||
#if DebugEmbargos
|
||||
Logger.LogDebug($"Sender loopback disembargo. Thread = {Thread.CurrentThread.Name}");
|
||||
|
Loading…
x
Reference in New Issue
Block a user