TaggingSocketFactory

SocketFactory to tag sockets per TrafficStats.

All created sockets will be tagged with the current thread id, and if running on an SDK >= P, with the process UID.

Properties

Link copied to clipboard
public final static TaggingSocketFactory INSTANCE
Link copied to clipboard
private final SocketFactory origin

Base SocketFactory to which all creation requests are delegated.

Functions

Link copied to clipboard
public Unit configure(Socket socket)

Configure a socket after it is created by origin and before it is returned by create.

Link copied to clipboard
public Socket createSocket(InetAddress host, Integer port)
public Socket createSocket(String host, Integer port)
public Socket createSocket(InetAddress address, Integer port, InetAddress localAddress, Integer localPort)
public Socket createSocket(String host, Integer port, InetAddress localHost, Integer localPort)
Link copied to clipboard
public final SocketFactory getOrigin()

Base SocketFactory to which all creation requests are delegated.