else
{
try
{
// create NIO client and background thread
NettyNioClient client = new NettyNioClient(mainApp, false);
RspHandler handler = new RspHandler(null, false);
Thread t = new Thread(client);
t.setDaemon(true);
t.start();
// test authentication
client.testAuth(handler);
start = System.nanoTime();
while(!handler.isFinished())
{
curr = System.nanoTime();
diff = curr - start;
if(diff > (HelloNzbConstants.SERVER_TIMEOUT * NANO_MODIFIER))
break;
try
{
Thread.sleep(10);
}
catch(InterruptedException ex)
{
// do nothing ...
}
}
if(client != null)
client.shutdown(true, start + (HelloNzbConstants.SERVER_TIMEOUT * NANO_MODIFIER), false);
mainApp.resetThreadView();
if(diff > (HelloNzbConstants.SERVER_TIMEOUT * NANO_MODIFIER))
{