Module org.snmp4j

Class UdpTransportMapping

    • Constructor Detail

      • UdpTransportMapping

        public UdpTransportMapping​(UdpAddress udpAddress)
    • Method Detail

      • getAddress

        public UdpAddress getAddress()
        Returns the transport address that is configured for this transport mapping for sending and receiving messages.
        Returns:
        the Address used by this transport mapping. The returned instance must not be modified!
      • getListenAddress

        public UdpAddress getListenAddress()
        Description copied from interface: TransportMapping
        Returns the address that represents the actual incoming address this transport mapping uses to listen for incoming packets.
        Returns:
        the address for incoming packets or null this transport mapping is not configured to listen for incoming packets.
      • close

        public abstract void close()
                            throws java.io.IOException
        Description copied from interface: TransportMapping
        Closes the transport an releases all bound resources synchronously.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface TransportMapping<UdpAddress>
        Specified by:
        close in class AbstractTransportMapping<UdpAddress>
        Throws:
        java.io.IOException - if any IO operation for the close fails.
      • sendMessage

        public abstract void sendMessage​(UdpAddress address,
                                         byte[] message,
                                         TransportStateReference tmStateReference,
                                         long timeoutMillis,
                                         int maxRetries)
                                  throws java.io.IOException
        Description copied from interface: TransportMapping
        Sends a message to the supplied address using this transport.
        Specified by:
        sendMessage in interface TransportMapping<UdpAddress>
        Specified by:
        sendMessage in class AbstractTransportMapping<UdpAddress>
        Parameters:
        address - an Address instance denoting the target address.
        message - the whole message as an array of bytes.
        tmStateReference - the (optional) transport model state reference as defined by RFC 5590 section 6.1.
        timeoutMillis - maximum number of milli seconds the connection creation might take (if connection based).
        maxRetries - maximum retries during connection creation.
        Throws:
        java.io.IOException - if any underlying IO operation fails.