keep alive should get a response

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@631965 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-02-28 13:29:35 +00:00
parent dd35ef43e5
commit a36426d202
1 changed files with 27 additions and 13 deletions

View File

@ -126,7 +126,9 @@ public class InactivityMonitor extends TransportFilter {
ASYNC_TASKS.execute(new Runnable() {
public void run() {
try {
oneway(new KeepAliveInfo());
KeepAliveInfo info = new KeepAliveInfo();
info.setResponseRequired(true);
oneway(info);
} catch (IOException e) {
onException(e);
}
@ -173,16 +175,27 @@ public class InactivityMonitor extends TransportFilter {
commandReceived.set(true);
inReceive.set(true);
try {
if (command.getClass() == KeepAliveInfo.class) {
KeepAliveInfo info = (KeepAliveInfo) command;
if (info.isResponseRequired()) {
try {
info.setResponseRequired(false);
oneway(info);
} catch (IOException e) {
onException(e);
}
}
} else {
if (command.getClass() == WireFormatInfo.class) {
synchronized (this) {
IOException error=null;
remoteWireFormatInfo = (WireFormatInfo)command;
IOException error = null;
remoteWireFormatInfo = (WireFormatInfo) command;
try {
startMonitorThreads();
} catch (IOException e) {
error = e;
}
if( error!=null ) {
if (error != null) {
onException(error);
}
}
@ -190,6 +203,7 @@ public class InactivityMonitor extends TransportFilter {
synchronized (readChecker) {
transportListener.onCommand(command);
}
}
} finally {
inReceive.set(false);