Loading libs/binder/include_rpc_unstable/binder_rpc_unstable.hpp +11 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,17 @@ void ARpcServer_setSupportedFileDescriptorTransportModes( const ARpcSession_FileDescriptorTransportMode modes[], size_t modes_len); // Sets the maximum number of threads that the Server will use for // incoming client connections. // // This must be called before adding a client session. This corresponds // to the number of incoming connections to RpcSession objects in the // server, which will correspond to the number of outgoing connections // in client RpcSession objects. // // If this is not specified, this will be a single-threaded server. void ARpcServer_setMaxThreads(ARpcServer* server, size_t threads); // Runs ARpcServer_join() in a background thread. Immediately returns. void ARpcServer_start(ARpcServer* server); Loading libs/binder/libbinder_rpc_unstable.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,10 @@ void ARpcServer_setSupportedFileDescriptorTransportModes( server->setSupportedFileDescriptorTransportModes(modevec); } void ARpcServer_setMaxThreads(ARpcServer* handle, size_t threads) { handleToStrongPointer<RpcServer>(handle)->setMaxThreads(threads); } void ARpcServer_start(ARpcServer* handle) { handleToStrongPointer<RpcServer>(handle)->start(); } Loading libs/binder/rust/rpcbinder/src/server/android.rs +14 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,20 @@ impl RpcServerRef { } } /// Sets the max number of threads this Server uses for incoming client connections. /// /// This must be called before adding a client session. This corresponds /// to the number of incoming connections to RpcSession objects in the /// server, which will correspond to the number of outgoing connections /// in client RpcSession objects. Specifically this is useful for handling /// client-side callback connections. /// /// If this is not specified, this will be a single-threaded server. pub fn set_max_threads(&self, count: usize) { // SAFETY: RpcServerRef wraps a valid pointer to an ARpcServer. unsafe { binder_rpc_unstable_bindgen::ARpcServer_setMaxThreads(self.as_ptr(), count) }; } /// Starts a new background thread and calls join(). Returns immediately. pub fn start(&self) { // SAFETY: RpcServerRef wraps a valid pointer to an ARpcServer. Loading Loading
libs/binder/include_rpc_unstable/binder_rpc_unstable.hpp +11 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,17 @@ void ARpcServer_setSupportedFileDescriptorTransportModes( const ARpcSession_FileDescriptorTransportMode modes[], size_t modes_len); // Sets the maximum number of threads that the Server will use for // incoming client connections. // // This must be called before adding a client session. This corresponds // to the number of incoming connections to RpcSession objects in the // server, which will correspond to the number of outgoing connections // in client RpcSession objects. // // If this is not specified, this will be a single-threaded server. void ARpcServer_setMaxThreads(ARpcServer* server, size_t threads); // Runs ARpcServer_join() in a background thread. Immediately returns. void ARpcServer_start(ARpcServer* server); Loading
libs/binder/libbinder_rpc_unstable.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,10 @@ void ARpcServer_setSupportedFileDescriptorTransportModes( server->setSupportedFileDescriptorTransportModes(modevec); } void ARpcServer_setMaxThreads(ARpcServer* handle, size_t threads) { handleToStrongPointer<RpcServer>(handle)->setMaxThreads(threads); } void ARpcServer_start(ARpcServer* handle) { handleToStrongPointer<RpcServer>(handle)->start(); } Loading
libs/binder/rust/rpcbinder/src/server/android.rs +14 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,20 @@ impl RpcServerRef { } } /// Sets the max number of threads this Server uses for incoming client connections. /// /// This must be called before adding a client session. This corresponds /// to the number of incoming connections to RpcSession objects in the /// server, which will correspond to the number of outgoing connections /// in client RpcSession objects. Specifically this is useful for handling /// client-side callback connections. /// /// If this is not specified, this will be a single-threaded server. pub fn set_max_threads(&self, count: usize) { // SAFETY: RpcServerRef wraps a valid pointer to an ARpcServer. unsafe { binder_rpc_unstable_bindgen::ARpcServer_setMaxThreads(self.as_ptr(), count) }; } /// Starts a new background thread and calls join(). Returns immediately. pub fn start(&self) { // SAFETY: RpcServerRef wraps a valid pointer to an ARpcServer. Loading