Package 

Class BinderServer

  • All Implemented Interfaces:
    io.grpc.binder.internal.LeakSafeOneWayBinder.TransactionHandler , io.grpc.internal.InternalServer

    @ThreadSafe() 
    public final class BinderServer
     implements InternalServer, LeakSafeOneWayBinder.TransactionHandler
                        

    A gRPC InternalServer which accepts connections via a host AndroidService.

    Multiple incoming connections transports may be active at a time.

    IMPORTANT: This implementation must comply with this published wire format. https://github.com/grpc/proposal/blob/master/L73-java-binderchannel/wireformat.md

    • Method Summary

      Modifier and Type Method Description
      IBinder getHostBinder() Return the binder we're listening on.
      synchronized void start(ServerListener serverListener)
      SocketAddress getListenSocketAddress()
      List<out SocketAddress> getListenSocketAddresses()
      InternalInstrumented<InternalChannelz.SocketStats> getListenSocketStats()
      List<InternalInstrumented<InternalChannelz.SocketStats>> getListenSocketStatsList()
      synchronized void shutdown()
      String toString()
      synchronized boolean handleTransaction(int code, Parcel parcel) Delivers a binder transaction to this handler.
      • Methods inherited from class io.grpc.internal.InternalServer

        getListenSocketAddress, getListenSocketAddresses, getListenSocketStats, getListenSocketStatsList, shutdown, start
      • Methods inherited from class io.grpc.binder.internal.LeakSafeOneWayBinder.TransactionHandler

        handleTransaction
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • start

         synchronized void start(ServerListener serverListener)
      • handleTransaction

         synchronized boolean handleTransaction(int code, Parcel parcel)

        Delivers a binder transaction to this handler.

        Implementations need not be thread-safe. Each invocation "happens-before" the next in thesame order that transactions were sent ("oneway" semantics). However implementations must notbe thread-hostile as different calls can come in on different threads.

        {@code parcel} is only valid for the duration of this call. Ownership is retained by thecaller.

        Parameters:
        code - the transaction code originally passed to transact