git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1188925 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2011-10-25 21:23:30 +00:00
parent ef850895a2
commit 28e9cd7eee
1 changed files with 28 additions and 22 deletions

View File

@ -1,5 +1,5 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
gxfdgvdfg * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
@ -537,27 +537,33 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
final CountDownLatch latch = new CountDownLatch(1);
DefaultThreadPools.getDefaultTaskRunnerFactory().execute(new Runnable() {
public void run() {
try {
socket.close();
} catch (IOException e) {
LOG.debug("Caught exception closing socket",e);
}finally {
if (LOG.isDebugEnabled()) {
LOG.debug("Caught exception closing socket", e);
}
} finally {
latch.countDown();
}
}
});
latch.await(1,TimeUnit.SECONDS);
}else {
try {
latch.await(1,TimeUnit.SECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
} else {
try {
socket.close();
} catch (IOException e) {
LOG.debug("Caught exception closing socket",e);
}
}
}
}