Module org.snmp4j

Class AbstractConnectionOrientedTransportMapping<A extends Address,​S extends AbstractSocketEntry<A>>

    • Constructor Detail

      • AbstractConnectionOrientedTransportMapping

        public AbstractConnectionOrientedTransportMapping()
    • Method Detail

      • getConnectionTimeout

        public long getConnectionTimeout()
        Gets the connection timeout. This timeout specifies the time a connection may be idle before it is closed.
        Specified by:
        getConnectionTimeout in interface ConnectionOrientedTransportMapping<A extends Address>
        Returns:
        long the idle timeout in milliseconds.
      • setConnectionTimeout

        public void setConnectionTimeout​(long connectionTimeout)
        Sets the connection timeout. This timeout specifies the time a connection may be idle before it is closed.
        Specified by:
        setConnectionTimeout in interface ConnectionOrientedTransportMapping<A extends Address>
        Parameters:
        connectionTimeout - the idle timeout in milliseconds. A zero or negative value will disable any timeout and connections opened by this transport mapping will stay opened until they are explicitly closed.
      • setSocketOptions

        protected void setSocketOptions​(ServerSocket serverSocket)
        Sets optional server socket options. The default implementation does nothing.
        Parameters:
        serverSocket - the ServerSocket to apply additional non-default options.
      • closeSockets

        protected void closeSockets​(Map<A,​S> sockets)
      • close

        public boolean close​(A remoteAddress)
                      throws IOException
        Closes a connection to the supplied remote address, if it is open. This method is particularly useful when not using a timeout for remote connections.
        Specified by:
        close in interface ConnectionOrientedTransportMapping<A extends Address>
        Parameters:
        remoteAddress - the address of the peer socket.
        Returns:
        true if the connection has been closed and false if there was nothing to close.
        Throws:
        IOException - if the remote address cannot be closed due to an IO exception.
        Since:
        1.7.1
      • wakeupServerSelector

        public abstract void wakeupServerSelector()
      • cancelNonServerSelectionKey

        protected void cancelNonServerSelectionKey​(SelectionKey sk)
      • getMaxBusyLoops

        protected int getMaxBusyLoops()
      • setMaxBusyLoops

        protected void setMaxBusyLoops​(int maxBusyLoops)