/** * Starts the listener thread that accepts incoming messages. The thread is * started in daemon mode and thus it will not block application terminated. * Nevertheless, the {@link #close()} method should be called to stop the * listen thread gracefully and free associated ressources. * * @throws IOException */ public synchronized void listen() throws IOException { if (listener != null) { throw new SocketException("Port already listening"); } ensureSocket(); listenerThread = new ListenThread(); listener = SNMP4JSettings.getThreadFactory().createWorkerThread( "DefaultUDPTransportMapping_"+getAddress(), listenerThread, true); listener.run(); }
/** * Starts the listener thread that accepts incoming messages. The thread is * started in daemon mode and thus it will not block application terminated. * Nevertheless, the {@link #close()} method should be called to stop the * listen thread gracefully and free associated ressources. * * @throws IOException * if the listen port could not be bound to the server thread. */ public synchronized void listen() throws IOException { if (listener != null) { throw new SocketException("Port already listening"); } ensureSocket(); listenerThread = new ListenThread(); listener = SNMP4JSettings.getThreadFactory().createWorkerThread( "DefaultUDPTransportMapping_"+getAddress(), listenerThread, true); listener.run(); }
getAddress() + " is set to: " + socket.getReceiveBufferSize());
getAddress() + " is set to: " + socketCopy.getReceiveBufferSize());
getAddress() + " is set to: " + socketCopy.getReceiveBufferSize());