Package dalvik.system

Class SocketTagger

java.lang.Object
dalvik.system.SocketTagger

public abstract class SocketTagger
extends Object
Callbacks for socket assignment and reassignment.
  • Constructor Details

    • SocketTagger

      public SocketTagger()
  • Method Details

    • tag

      public abstract void tag​(FileDescriptor socketDescriptor) throws SocketException
      Notified when socketDescriptor is either assigned to the current thread. The socket is either newly connected or reused from a connection pool. Implementations of this method should be thread-safe.
      Throws:
      SocketException
    • untag

      public abstract void untag​(FileDescriptor socketDescriptor) throws SocketException
      Notified when socketDescriptor is released from the current thread to a connection pool. Implementations of this method should be thread-safe.

      Note: this method will not be invoked when the socket is closed.

      Throws:
      SocketException
    • tag

      public final void tag​(Socket socket) throws SocketException
      Throws:
      SocketException
    • untag

      public final void untag​(Socket socket) throws SocketException
      Throws:
      SocketException
    • set

      public static void set​(SocketTagger tagger)
      Sets this process' socket tagger to tagger.
    • get

      public static SocketTagger get()
      Returns this process socket tagger.