Close the transport if for some reason the connection cannot be accepted.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@376044 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-02-08 20:20:24 +00:00
parent 43d4e983dc
commit 7e672d4150
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import org.apache.activemq.transport.TransportServer;
import org.apache.activemq.transport.discovery.DiscoveryAgent; import org.apache.activemq.transport.discovery.DiscoveryAgent;
import org.apache.activemq.transport.discovery.DiscoveryAgentFactory; import org.apache.activemq.transport.discovery.DiscoveryAgentFactory;
import org.apache.activemq.util.ServiceStopper; import org.apache.activemq.util.ServiceStopper;
import org.apache.activemq.util.ServiceSupport;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -128,6 +129,7 @@ public class TransportConnector implements Connector {
connection.start(); connection.start();
} }
catch (Exception e) { catch (Exception e) {
ServiceSupport.dispose(transport);
onAcceptError(e); onAcceptError(e);
} }
} }