/** * 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 java.io.IOException if any. */ public synchronized void listen() throws IOException { if (listener != null) { throw new SocketException("Port already listening"); } listenerThread = new ListenThread(); listener = SNMP4JSettings.getThreadFactory().createWorkerThread( "DefaultUDPTransportMapping_" + getAddress(), listenerThread, true); listener.run(); }
@Override public void listen() throws IOException { listening = true; sessionID++; QueueProcessor listener = new QueueProcessor(responses, this); this.listenThread = SNMP4JSettings.getThreadFactory().createWorkerThread( "DummyTransportMapping_"+getListenAddress(), listener, true); this.listenThread.run(); }
@Override public void listen() throws IOException { listening = true; sessionID++; QueueProcessor listener = new QueueProcessor(responses, this); this.listenThread = SNMP4JSettings.getThreadFactory().createWorkerThread( "DummyTransportMapping_" + getListenAddress(), listener, true); this.listenThread.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 */ 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_" + getListenAddress(), 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(); }
/** * Listen for incoming and outgoing requests. If the {@code serverEnabled} * member is {@code false} the server for incoming requests is not * started. This starts the internal server thread that processes messages. * * @throws java.net.SocketException * when the transport is already listening for incoming/outgoing messages. * @throws java.io.IOException * if the listen port could not be bound to the server thread. */ public synchronized void listen() throws IOException { if (server != null) { throw new SocketException("Port already listening"); } try { serverThread = new ServerThread(); if (logger.isInfoEnabled()) { logger.info("TCP address " + tcpAddress + " bound successfully"); } } catch (NoSuchAlgorithmException e) { throw new IOException("SSL not available: " + e.getMessage(), e); } server = SNMP4JSettings.getThreadFactory().createWorkerThread( "TLSTM_" + getListenAddress(), serverThread, true); if (connectionTimeout > 0) { // run as daemon socketCleaner = SNMP4JSettings.getTimerFactory().createTimer(); } server.run(); }
/** * Listen for incoming and outgoing requests. If the <code>serverEnabled</code> * member is <code>false</code> the server for incoming requests is not * started. This starts the internal server thread that processes messages. * @throws SocketException * when the transport is already listening for incoming/outgoing messages. * @throws IOException */ public synchronized void listen() throws java.io.IOException { if (server != null) { throw new SocketException("Port already listening"); } serverThread = new ServerThread(); server = SNMP4JSettings.getThreadFactory().createWorkerThread( "DefaultTCPTransportMapping_"+getAddress(), serverThread, true); if (connectionTimeout > 0) { // run as daemon socketCleaner = SNMP4JSettings.getTimerFactory().createTimer(); } server.run(); }
/** * Listen for incoming and outgoing requests. If the {@code serverEnabled} * member is {@code false} the server for incoming requests is not * started. This starts the internal server thread that processes messages. * @throws java.net.SocketException * when the transport is already listening for incoming/outgoing messages. * @throws java.io.IOException * if the listen port could not be bound to the server thread. */ public synchronized void listen() throws IOException { if (server != null) { throw new SocketException("Port already listening"); } try { serverThread = new ServerThread(); if (logger.isInfoEnabled()) { logger.info("TCP address "+getListenAddress()+" bound successfully"); } } catch (NoSuchAlgorithmException e) { throw new IOException("SSL not available: "+e.getMessage(), e); } server = SNMP4JSettings.getThreadFactory().createWorkerThread( "TLSTM_"+getAddress(), serverThread, true); if (connectionTimeout > 0) { // run as daemon socketCleaner = SNMP4JSettings.getTimerFactory().createTimer(); } server.run(); }
/** * Listen for incoming and outgoing requests. If the {@code serverEnabled} * member is {@code false} the server for incoming requests is not * started. This starts the internal server thread that processes messages. * @throws SocketException * when the transport is already listening for incoming/outgoing messages. * @throws IOException * if the listen port could not be bound to the server thread. */ public synchronized void listen() throws java.io.IOException { if (server != null) { throw new SocketException("Port already listening"); } serverThread = new ServerThread(); if (logger.isInfoEnabled()) { logger.info("TCP address "+getListenAddress()+" bound successfully"); } server = SNMP4JSettings.getThreadFactory().createWorkerThread( "DefaultTCPTransportMapping_"+getAddress(), serverThread, true); if (connectionTimeout > 0) { // run as daemon socketCleaner = SNMP4JSettings.getTimerFactory().createTimer(); } server.run(); }
/** * Listen for incoming and outgoing requests. If the {@code serverEnabled} * member is {@code false} the server for incoming requests is not * started. This starts the internal server thread that processes messages. * * @throws SocketException * when the transport is already listening for incoming/outgoing messages. * @throws IOException * if the listen port could not be bound to the server thread. */ public synchronized void listen() throws java.io.IOException { if (server != null) { throw new SocketException("Port already listening"); } serverThread = new ServerThread(); if (logger.isInfoEnabled()) { logger.info("TCP address " + getListenAddress() + " bound successfully"); } server = SNMP4JSettings.getThreadFactory().createWorkerThread( "DefaultTCPTransportMapping_" + getAddress(), serverThread, true); if (getConnectionTimeout() > 0) { // run as daemon socketCleaner = SNMP4JSettings.getTimerFactory().createTimer(); } server.run(); }