Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
d122a3db
Commit
d122a3db
authored
Nov 11, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename connect() -> restore().
parent
9e411b7f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
rpc-test.c++
c++/src/capnp/rpc-test.c++
+1
-1
rpc-twoparty-test.c++
c++/src/capnp/rpc-twoparty-test.c++
+1
-1
rpc.c++
c++/src/capnp/rpc.c++
+3
-3
rpc.h
c++/src/capnp/rpc.h
+5
-5
No files found.
c++/src/capnp/rpc-test.c++
View file @
d122a3db
...
@@ -256,7 +256,7 @@ protected:
...
@@ -256,7 +256,7 @@ protected:
hostId
.
setHost
(
"server"
);
hostId
.
setHost
(
"server"
);
ref
.
getObjectId
().
initAs
<
test
::
TestSturdyRefObjectId
>
().
setTag
(
tag
);
ref
.
getObjectId
().
initAs
<
test
::
TestSturdyRefObjectId
>
().
setTag
(
tag
);
return
rpcClient
.
connect
(
hostId
,
ref
.
getObjectId
());
return
rpcClient
.
restore
(
hostId
,
ref
.
getObjectId
());
}
}
RpcTest
()
RpcTest
()
...
...
c++/src/capnp/rpc-twoparty-test.c++
View file @
d122a3db
...
@@ -76,7 +76,7 @@ Capability::Client getPersistentCap(RpcSystem<rpc::twoparty::SturdyRefHostId>& c
...
@@ -76,7 +76,7 @@ Capability::Client getPersistentCap(RpcSystem<rpc::twoparty::SturdyRefHostId>& c
objectIdMessage
.
initRoot
<
test
::
TestSturdyRefObjectId
>
().
setTag
(
tag
);
objectIdMessage
.
initRoot
<
test
::
TestSturdyRefObjectId
>
().
setTag
(
tag
);
// Connect to the remote capability.
// Connect to the remote capability.
return
client
.
connect
(
hostId
,
objectIdMessage
.
getRoot
<
ObjectPointer
>
());
return
client
.
restore
(
hostId
,
objectIdMessage
.
getRoot
<
ObjectPointer
>
());
}
}
TEST
(
TwoPartyNetwork
,
Basic
)
{
TEST
(
TwoPartyNetwork
,
Basic
)
{
...
...
c++/src/capnp/rpc.c++
View file @
d122a3db
...
@@ -1919,7 +1919,7 @@ public:
...
@@ -1919,7 +1919,7 @@ public:
}
}
}
}
Capability
::
Client
connect
(
_
::
StructReader
hostId
,
ObjectPointer
::
Reader
objectId
)
{
Capability
::
Client
restore
(
_
::
StructReader
hostId
,
ObjectPointer
::
Reader
objectId
)
{
KJ_IF_MAYBE
(
connection
,
network
.
baseConnectToRefHost
(
hostId
))
{
KJ_IF_MAYBE
(
connection
,
network
.
baseConnectToRefHost
(
hostId
))
{
auto
lock
=
connections
.
lockExclusive
();
auto
lock
=
connections
.
lockExclusive
();
auto
&
state
=
getConnectionState
(
kj
::
mv
(
*
connection
),
*
lock
);
auto
&
state
=
getConnectionState
(
kj
::
mv
(
*
connection
),
*
lock
);
...
@@ -1985,9 +1985,9 @@ RpcSystemBase::RpcSystemBase(VatNetworkBase& network, kj::Maybe<SturdyRefRestore
...
@@ -1985,9 +1985,9 @@ RpcSystemBase::RpcSystemBase(VatNetworkBase& network, kj::Maybe<SturdyRefRestore
RpcSystemBase
::
RpcSystemBase
(
RpcSystemBase
&&
other
)
=
default
;
RpcSystemBase
::
RpcSystemBase
(
RpcSystemBase
&&
other
)
=
default
;
RpcSystemBase
::~
RpcSystemBase
()
noexcept
(
false
)
{}
RpcSystemBase
::~
RpcSystemBase
()
noexcept
(
false
)
{}
Capability
::
Client
RpcSystemBase
::
base
Connect
(
Capability
::
Client
RpcSystemBase
::
base
Restore
(
_
::
StructReader
hostId
,
ObjectPointer
::
Reader
objectId
)
{
_
::
StructReader
hostId
,
ObjectPointer
::
Reader
objectId
)
{
return
impl
->
connect
(
hostId
,
objectId
);
return
impl
->
restore
(
hostId
,
objectId
);
}
}
}
// namespace _ (private)
}
// namespace _ (private)
...
...
c++/src/capnp/rpc.h
View file @
d122a3db
...
@@ -89,7 +89,7 @@ private:
...
@@ -89,7 +89,7 @@ private:
class
Impl
;
class
Impl
;
kj
::
Own
<
Impl
>
impl
;
kj
::
Own
<
Impl
>
impl
;
Capability
::
Client
base
Connect
(
_
::
StructReader
hostId
,
ObjectPointer
::
Reader
objectId
);
Capability
::
Client
base
Restore
(
_
::
StructReader
hostId
,
ObjectPointer
::
Reader
objectId
);
// TODO(someday): Maybe define a public API called `TypelessStruct` so we don't have to rely
// TODO(someday): Maybe define a public API called `TypelessStruct` so we don't have to rely
// on `_::StructReader` here?
// on `_::StructReader` here?
...
@@ -259,7 +259,7 @@ public:
...
@@ -259,7 +259,7 @@ public:
const
kj
::
EventLoop
&
eventLoop
);
const
kj
::
EventLoop
&
eventLoop
);
RpcSystem
(
RpcSystem
&&
other
)
=
default
;
RpcSystem
(
RpcSystem
&&
other
)
=
default
;
Capability
::
Client
connect
(
typename
SturdyRefHostId
::
Reader
hostId
,
Capability
::
Client
restore
(
typename
SturdyRefHostId
::
Reader
hostId
,
ObjectPointer
::
Reader
objectId
);
ObjectPointer
::
Reader
objectId
);
// Restore the given SturdyRef from the network and return the capability representing it.
// Restore the given SturdyRef from the network and return the capability representing it.
};
};
...
@@ -289,7 +289,7 @@ RpcSystem<SturdyRefHostId> makeRpcClient(
...
@@ -289,7 +289,7 @@ RpcSystem<SturdyRefHostId> makeRpcClient(
// MyNetwork network(eventLoop);
// MyNetwork network(eventLoop);
// MyRestorer restorer;
// MyRestorer restorer;
// auto client = makeRpcClient(network, restorer);
// auto client = makeRpcClient(network, restorer);
// MyCapability::Client cap = client.
connect(myRef
).castAs<MyCapability>();
// MyCapability::Client cap = client.
restore(hostId, objId
).castAs<MyCapability>();
// auto response = eventLoop.wait(cap.fooRequest().send());
// auto response = eventLoop.wait(cap.fooRequest().send());
// handleMyResponse(response);
// handleMyResponse(response);
...
@@ -364,9 +364,9 @@ RpcSystem<SturdyRefHostId>::RpcSystem(
...
@@ -364,9 +364,9 @@ RpcSystem<SturdyRefHostId>::RpcSystem(
:
_
::
RpcSystemBase
(
network
,
restorer
,
eventLoop
)
{}
:
_
::
RpcSystemBase
(
network
,
restorer
,
eventLoop
)
{}
template
<
typename
SturdyRefHostId
>
template
<
typename
SturdyRefHostId
>
Capability
::
Client
RpcSystem
<
SturdyRefHostId
>::
connect
(
Capability
::
Client
RpcSystem
<
SturdyRefHostId
>::
restore
(
typename
SturdyRefHostId
::
Reader
hostId
,
ObjectPointer
::
Reader
objectId
)
{
typename
SturdyRefHostId
::
Reader
hostId
,
ObjectPointer
::
Reader
objectId
)
{
return
base
Connect
(
_
::
PointerHelpers
<
SturdyRefHostId
>::
getInternalReader
(
hostId
),
objectId
);
return
base
Restore
(
_
::
PointerHelpers
<
SturdyRefHostId
>::
getInternalReader
(
hostId
),
objectId
);
}
}
template
<
typename
SturdyRefHostId
,
typename
LocalSturdyRefObjectId
,
template
<
typename
SturdyRefHostId
,
typename
LocalSturdyRefObjectId
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment