private ListenerRegistration<SchemaServiceListener> listenerRegistration;
private ServiceTracker<Broker, Broker> brokerServiceTrancker;
private BundleContext bundleContext;
- private ProviderSession session;
private Thread webSocketServerThread;
@Override
}
}
webSocketServerThread.interrupt();
- session.close();
brokerServiceTrancker.close();
}
private static final AtomicLong sesssionId = new AtomicLong();
private final InetSocketAddress clientAddress;
private final AuthProvider authProvider;
- private boolean up = false;
+ private volatile boolean up = false;
private NetconfSSHServer(int serverPort,InetSocketAddress clientAddress, AuthProvider authProvider) throws IllegalStateException, IOException {
while (up) {
logger.trace("Starting new socket thread.");
try {
- SocketThread.start(ss.accept(), clientAddress, sesssionId.incrementAndGet(), authProvider);
- } catch (IOException e) {
- logger.error("Exception occurred during socket thread initialization {}", e);
+ SocketThread.start(ss.accept(), clientAddress, sesssionId.incrementAndGet(), authProvider);
+ }
+ catch (IOException e) {
+ if( up ) {
+ logger.error("Exception occurred during socket thread initialization", e);
+ }
+ else {
+ // We're shutting down so an exception is expected as the socket's been closed.
+ // Log to debug.
+ logger.debug("Shutting down - got expected exception: " + e);
+ }
}
}
}