use of org.jboss.netty.channel.local.LocalAddress in project databus by linkedin.
the class SimpleTestServerConnection method start.
public void start(final int localAddr) {
_shutdownRequested = false;
_shutdown = false;
_thread = new Thread(new Runnable() {
@Override
public void run() {
SocketAddress serverAddr = (ServerType.LOCAL == _serverType) ? new LocalAddress(localAddr) : new InetSocketAddress(localAddr);
//System.err.println("Server running on thread: " + Thread.currentThread());
_channel = _srvBootstrap.bind(serverAddr);
_lock.lock();
try {
_started = true;
_startedCondition.signalAll();
while (!_shutdownRequested) {
try {
_shutdownReqCondition.await();
} catch (InterruptedException ie) {
}
}
_shutdown = true;
_shutdownCondition.signalAll();
} finally {
_lock.unlock();
}
}
});
_thread.setDaemon(true);
_thread.start();
}
Aggregations