Loading libs/binder/RpcServer.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -565,12 +565,9 @@ status_t RpcServer::setupSocketServer(const RpcSocketAddress& addr) { } status_t RpcServer::setupRawSocketServer(base::unique_fd socket_fd) { LOG_ALWAYS_FATAL_IF(!socket_fd.ok(), "Socket must be setup to listen."); RpcTransportFd transportFd(std::move(socket_fd)); if (!transportFd.fd.ok()) { int savedErrno = errno; ALOGE("Could not get initialized Unix socket: %s", strerror(savedErrno)); return -savedErrno; } // Right now, we create all threads at once, making accept4 slow. To avoid hanging the client, // the backlog is increased to a large number. // TODO(b/189955605): Once we create threads dynamically & lazily, the backlog can be reduced Loading libs/binder/libbinder_rpc_unstable.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ bool RunInitUnixDomainRpcServer(AIBinder* service, const char* name, void (*readyCallback)(void* param), void* param) { auto server = RpcServer::make(); auto fd = unique_fd(android_get_control_socket(name)); if (!fd.ok()) { LOG(ERROR) << "Failed to get fd for the socket:" << name; return false; } if (status_t status = server->setupRawSocketServer(std::move(fd)); status != OK) { LOG(ERROR) << "Failed to set up Unix Domain RPC server with name " << name << " error: " << statusToString(status).c_str(); Loading Loading
libs/binder/RpcServer.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -565,12 +565,9 @@ status_t RpcServer::setupSocketServer(const RpcSocketAddress& addr) { } status_t RpcServer::setupRawSocketServer(base::unique_fd socket_fd) { LOG_ALWAYS_FATAL_IF(!socket_fd.ok(), "Socket must be setup to listen."); RpcTransportFd transportFd(std::move(socket_fd)); if (!transportFd.fd.ok()) { int savedErrno = errno; ALOGE("Could not get initialized Unix socket: %s", strerror(savedErrno)); return -savedErrno; } // Right now, we create all threads at once, making accept4 slow. To avoid hanging the client, // the backlog is increased to a large number. // TODO(b/189955605): Once we create threads dynamically & lazily, the backlog can be reduced Loading
libs/binder/libbinder_rpc_unstable.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ bool RunInitUnixDomainRpcServer(AIBinder* service, const char* name, void (*readyCallback)(void* param), void* param) { auto server = RpcServer::make(); auto fd = unique_fd(android_get_control_socket(name)); if (!fd.ok()) { LOG(ERROR) << "Failed to get fd for the socket:" << name; return false; } if (status_t status = server->setupRawSocketServer(std::move(fd)); status != OK) { LOG(ERROR) << "Failed to set up Unix Domain RPC server with name " << name << " error: " << statusToString(status).c_str(); Loading