-
August 17th, 2013, 04:06 AM
#1
Need some help with this tcp proxy
Hey, im using this tcp proxy: https://github.com/terma/java-nio-tcp-proxy
but the shut down function doesn't work as it always gives null workers showing "already been shutdown"
https://github.com/terma/java-nio-tc...TcpServer.java
Code:
public void shutdown() {
if (workers == null) {
if (LOGGER.isLoggable(Level.INFO))
LOGGER.info(name + " already been shutdown");
return;
}
if (LOGGER.isLoggable(Level.INFO))
LOGGER.info("Starting shutdown " + name);
for (final Thread worker : workers) {
worker.interrupt();
try {
worker.join();
} catch (InterruptedException exception) {
Thread.currentThread().interrupt();
}
}
workers = null;
TcpServerHandler handler;
while ((handler = handlers.poll()) != null) handler.destroy();
handlers = null;
if (LOGGER.isLoggable(Level.INFO))
LOGGER.info(name + " was shutdown");
}
could anyone help?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|