mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/branches/activemq-4.0@443273 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
125fbfed53
commit
beb72f6403
|
@ -95,6 +95,7 @@ public abstract class AbstractConnection implements Service, Connection, Task, C
|
|||
|
||||
private WireFormatInfo wireFormatInfo;
|
||||
protected boolean disposed=false;
|
||||
protected IOException transportException;
|
||||
|
||||
static class ConnectionState extends org.apache.activemq.state.ConnectionState {
|
||||
private final ConnectionContext context;
|
||||
|
@ -175,6 +176,7 @@ public abstract class AbstractConnection implements Service, Connection, Task, C
|
|||
|
||||
public void serviceTransportException(IOException e) {
|
||||
if( !disposed ) {
|
||||
transportException = e;
|
||||
if( transportLog.isDebugEnabled() )
|
||||
transportLog.debug("Transport failed: "+e,e);
|
||||
ServiceSupport.dispose(this);
|
||||
|
|
|
@ -22,13 +22,11 @@ import java.io.IOException;
|
|||
import org.apache.activemq.broker.ft.MasterBroker;
|
||||
import org.apache.activemq.command.BrokerInfo;
|
||||
import org.apache.activemq.command.Command;
|
||||
import org.apache.activemq.command.MessageDispatch;
|
||||
import org.apache.activemq.command.Response;
|
||||
import org.apache.activemq.command.ShutdownInfo;
|
||||
import org.apache.activemq.thread.TaskRunnerFactory;
|
||||
import org.apache.activemq.transport.DefaultTransportListener;
|
||||
import org.apache.activemq.transport.Transport;
|
||||
import org.apache.activemq.transport.TransportListener;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
@ -85,7 +83,12 @@ public class TransportConnection extends AbstractConnection {
|
|||
if (masterBroker != null){
|
||||
masterBroker.stop();
|
||||
}
|
||||
transport.oneway(new ShutdownInfo());
|
||||
|
||||
// If the transport has not failed yet,
|
||||
// notify the peer that we are doing a normal shutdown.
|
||||
if( transportException == null ) {
|
||||
transport.oneway(new ShutdownInfo());
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
//ignore.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -281,7 +281,9 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
|
|||
}
|
||||
|
||||
protected void doStop(ServiceStopper stopper) throws Exception {
|
||||
closeStreams();
|
||||
// Closing the streams flush the sockets before closing.. if the socket
|
||||
// is hung.. then this hangs the close.
|
||||
// closeStreams();
|
||||
if (socket != null) {
|
||||
socket.close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue