public abstract class UdpTransportMapping extends AbstractTransportMapping
UdpTransportMapping is the abstract base class for
UDP transport mappings.| Modifier and Type | Field and Description |
|---|---|
protected UdpAddress |
udpAddress |
asyncMsgProcessingSupported, maxInboundMessageSize, transportListener| Constructor and Description |
|---|
UdpTransportMapping(UdpAddress udpAddress) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Closes the transport an releases all bound resources synchronously.
|
UdpAddress |
getAddress()
Returns the transport address that is used by this transport mapping for
sending and receiving messages.
|
Address |
getListenAddress()
Returns the address that represents the incoming address this transport
mapping uses to listen for incoming packets.
|
Class |
getSupportedAddressClass()
Gets the
Address class that is this transport mapping
supports. |
abstract void |
listen()
Listen for incoming messages.
|
abstract void |
sendMessage(Address address,
byte[] message)
Sends a message to the supplied address using this transport.
|
addMessageDispatcher, addTransportListener, fireProcessMessage, getMaxInboundMessageSize, isAsyncMsgProcessingSupported, removeMessageDispatcher, removeTransportListener, setAsyncMsgProcessingSupportedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisListeningprotected UdpAddress udpAddress
public UdpTransportMapping(UdpAddress udpAddress)
public Class getSupportedAddressClass()
TransportMappingAddress class that is this transport mapping
supports.getSupportedAddressClass in interface TransportMappinggetSupportedAddressClass in class AbstractTransportMappingAddress.public UdpAddress getAddress()
Address used by this transport mapping. The returned
instance must not be modified!public Address getListenAddress()
TransportMappingnull this transport
mapping is not configured to listen for incoming packets.public abstract void listen()
throws IOException
TransportMappingTransportMapping.sendMessage(org.snmp4j.smi.Address, byte[]) is called for the
first time.listen in interface TransportMappinglisten in class AbstractTransportMappingIOExceptionpublic abstract void close()
throws IOException
TransportMappingclose in interface TransportMappingclose in class AbstractTransportMappingIOExceptionpublic abstract void sendMessage(Address address, byte[] message) throws IOException
TransportMappingsendMessage in interface TransportMappingsendMessage in class AbstractTransportMappingaddress - an Address instance denoting the target address.message - the whole message as an array of bytes.IOExceptionCopyright © 2014 SNMP4J.org. All rights reserved.