libbinder: RPC big 'session' rename
Before, 'connection' was used for a group of TCP connection. This
updates the names for most types to work with the following definitions:
- session - group of connections
- connection - a single tcp connection
- socket - only when referring to a socket being setup for a connection
Bug: N/A
Test: binderRpcTest, binderRpcBenchmark
Change-Id: If07afd9af680cd2a5ece6506df5383e5cc258663
diff --git a/libs/binder/tests/binderRpcBenchmark.cpp b/libs/binder/tests/binderRpcBenchmark.cpp
index ce47c0d..7f5dd7c 100644
--- a/libs/binder/tests/binderRpcBenchmark.cpp
+++ b/libs/binder/tests/binderRpcBenchmark.cpp
@@ -18,8 +18,8 @@
#include <android-base/logging.h>
#include <benchmark/benchmark.h>
#include <binder/Binder.h>
-#include <binder/RpcConnection.h>
#include <binder/RpcServer.h>
+#include <binder/RpcSession.h>
#include <thread>
@@ -30,8 +30,8 @@
using android::IBinder;
using android::interface_cast;
using android::OK;
-using android::RpcConnection;
using android::RpcServer;
+using android::RpcSession;
using android::sp;
using android::binder::Status;
@@ -46,17 +46,17 @@
}
};
-static sp<RpcConnection> gConnection = RpcConnection::make();
+static sp<RpcSession> gSession = RpcSession::make();
void BM_getRootObject(benchmark::State& state) {
while (state.KeepRunning()) {
- CHECK(gConnection->getRootObject() != nullptr);
+ CHECK(gSession->getRootObject() != nullptr);
}
}
BENCHMARK(BM_getRootObject);
void BM_pingTransaction(benchmark::State& state) {
- sp<IBinder> binder = gConnection->getRootObject();
+ sp<IBinder> binder = gSession->getRootObject();
CHECK(binder != nullptr);
while (state.KeepRunning()) {
@@ -66,7 +66,7 @@
BENCHMARK(BM_pingTransaction);
void BM_repeatString(benchmark::State& state) {
- sp<IBinder> binder = gConnection->getRootObject();
+ sp<IBinder> binder = gSession->getRootObject();
CHECK(binder != nullptr);
sp<IBinderRpcBenchmark> iface = interface_cast<IBinderRpcBenchmark>(binder);
CHECK(iface != nullptr);
@@ -95,7 +95,7 @@
BENCHMARK(BM_repeatString);
void BM_repeatBinder(benchmark::State& state) {
- sp<IBinder> binder = gConnection->getRootObject();
+ sp<IBinder> binder = gSession->getRootObject();
CHECK(binder != nullptr);
sp<IBinderRpcBenchmark> iface = interface_cast<IBinderRpcBenchmark>(binder);
CHECK(iface != nullptr);
@@ -128,7 +128,7 @@
for (size_t tries = 0; tries < 5; tries++) {
usleep(10000);
- if (gConnection->setupUnixDomainClient(addr.c_str())) goto success;
+ if (gSession->setupUnixDomainClient(addr.c_str())) goto success;
}
LOG(FATAL) << "Could not connect.";
success: