diff options
author | 2021-05-05 17:57:41 +0000 | |
---|---|---|
committer | 2021-05-05 18:35:39 +0000 | |
commit | bdb53ab39d08f9d189706532d347f575cbdac257 (patch) | |
tree | 334d8e4913299d27c1d5dcf3cc9a9e38dea0eb98 /libs/binder/RpcServer.cpp | |
parent | 2281985cd3e7f6eeeed48f5b4a677e2e665a2eef (diff) |
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
Diffstat (limited to 'libs/binder/RpcServer.cpp')
-rw-r--r-- | libs/binder/RpcServer.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index de7160ee08..786e2db3b3 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -149,38 +149,38 @@ void RpcServer::join() { { std::lock_guard<std::mutex> _l(mLock); - sp<RpcConnection> connection; - if (id == RPC_CONNECTION_ID_NEW) { + sp<RpcSession> session; + if (id == RPC_SESSION_ID_NEW) { // new client! - LOG_ALWAYS_FATAL_IF(mConnectionIdCounter >= INT32_MAX, "Out of connection IDs"); - mConnectionIdCounter++; + LOG_ALWAYS_FATAL_IF(mSessionIdCounter >= INT32_MAX, "Out of session IDs"); + mSessionIdCounter++; - connection = RpcConnection::make(); - connection->setForServer(wp<RpcServer>::fromExisting(this), mConnectionIdCounter); + session = RpcSession::make(); + session->setForServer(wp<RpcServer>::fromExisting(this), mSessionIdCounter); - mConnections[mConnectionIdCounter] = connection; + mSessions[mSessionIdCounter] = session; } else { - auto it = mConnections.find(id); - if (it == mConnections.end()) { - ALOGE("Cannot add thread, no record of connection with ID %d", id); + auto it = mSessions.find(id); + if (it == mSessions.end()) { + ALOGE("Cannot add thread, no record of session with ID %d", id); continue; } - connection = it->second; + session = it->second; } - connection->startThread(std::move(clientFd)); + session->startThread(std::move(clientFd)); } } } -std::vector<sp<RpcConnection>> RpcServer::listConnections() { +std::vector<sp<RpcSession>> RpcServer::listSessions() { std::lock_guard<std::mutex> _l(mLock); - std::vector<sp<RpcConnection>> connections; - for (auto& [id, connection] : mConnections) { + std::vector<sp<RpcSession>> sessions; + for (auto& [id, session] : mSessions) { (void)id; - connections.push_back(connection); + sessions.push_back(session); } - return connections; + return sessions; } bool RpcServer::setupSocketServer(const RpcSocketAddress& addr) { |