From c99390638c3c5d839ff26bebd5e0c60b292c3215 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Wed, 5 May 2021 17:57:41 +0000 Subject: 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 Fixes: 187393805 # conflict Test: binderRpcTest, binderRpcBenchmark Change-Id: If07afd9af680cd2a5ece6506df5383e5cc258663 (cherry picked from commit bdb53ab39d08f9d189706532d347f575cbdac257) --- libs/binder/RpcServer.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'libs/binder/RpcServer.cpp') 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 _l(mLock); - sp connection; - if (id == RPC_CONNECTION_ID_NEW) { + sp 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::fromExisting(this), mConnectionIdCounter); + session = RpcSession::make(); + session->setForServer(wp::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> RpcServer::listConnections() { +std::vector> RpcServer::listSessions() { std::lock_guard _l(mLock); - std::vector> connections; - for (auto& [id, connection] : mConnections) { + std::vector> 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) { -- cgit v1.2.3-59-g8ed1b