/** * Sends a SNMP message to the supplied address. * @param address * an {@code TcpAddress}. A {@code ClassCastException} is thrown * if {@code address} is not a {@code TcpAddress} instance. * @param message byte[] * the message to sent. * @param tmStateReference * the (optional) transport model state reference as defined by * RFC 5590 section 6.1. * @throws java.io.IOException * if an IO exception occurs while trying to send the message. */ public void sendMessage(TcpAddress address, byte[] message, TransportStateReference tmStateReference) throws IOException { if (server == null) { listen(); } serverThread.sendMessage(address, message, tmStateReference); }
/** * Sends a SNMP message to the supplied address. * * @param address * an {@code TcpAddress}. A {@code ClassCastException} is thrown * if {@code address} is not a {@code TcpAddress} instance. * @param message * byte[] * the message to sent. * @param tmStateReference * the (optional) transport model state reference as defined by * RFC 5590 section 6.1. * @param timeoutMillis * maximum number of milli seconds the connection creation might take (if connection based). * @param maxRetries * maximum retries during connection creation. * * @throws java.io.IOException * if an IO exception occurs while trying to send the message. */ public void sendMessage(TcpAddress address, byte[] message, TransportStateReference tmStateReference, long timeoutMillis, int maxRetries) throws IOException { if (server == null) { listen(); } serverThread.sendMessage(address, message, tmStateReference); }