为什么TCPTransport使用TCPEndpoints列表,是否用于TIME_WAIT和端口重用?

时间:2019-06-18 03:21:24

标签: java rmi

我试图了解Java rmi的实现。   在“ sun.rmi.transport.tcp”包中,有两个类TCPEndpoint.class和TCPTransport.class。而且我不知道为什么TCPTransport使用TCPEndpoint列表,我认为这可能是一个属性。是用于TIME_WAIT和端口重用吗?以及在TIME_WAIT连接结束时如何清除此列表?

public class TCPTransport extends Transport {
    static final Log tcpLog = Log.getLog("sun.rmi.transport.tcp", "tcp", LogStream.parseLevel((String)AccessController.doPrivileged(new GetPropertyAction("sun.rmi.transport.tcp.logLevel"))));
    private static final int maxConnectionThreads = (Integer)AccessController.doPrivileged(new GetIntegerAction("sun.rmi.transport.tcp.maxConnectionThreads", 2147483647));
    private static final long threadKeepAliveTime = (Long)AccessController.doPrivileged(new GetLongAction("sun.rmi.transport.tcp.threadKeepAliveTime", 60000L));
    private static final ExecutorService connectionThreadPool;
    private static final boolean disableIncomingHttp;
    private static final AtomicInteger connectionCount;
    private static final ThreadLocal<TCPTransport.ConnectionHandler> threadConnectionHandler;
    private static final AccessControlContext NOPERMS_ACC;

    private final LinkedList<TCPEndpoint> epList;

    private int exportCount = 0;
    private ServerSocket server = null;
    private final Map<TCPEndpoint, Reference<TCPChannel>> channelTable = new WeakHashMap();
    static final RMISocketFactory defaultSocketFactory;
    private static final int connectionReadTimeout;
}

0 个答案:

没有答案