mirror of
https://github.com/apache/activemq.git
synced 2025-02-06 01:59:15 +00:00
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:
parent
dd35ef43e5
commit
a36426d202
@ -126,7 +126,9 @@ public class InactivityMonitor extends TransportFilter {
|
|||||||
ASYNC_TASKS.execute(new Runnable() {
|
ASYNC_TASKS.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
oneway(new KeepAliveInfo());
|
KeepAliveInfo info = new KeepAliveInfo();
|
||||||
|
info.setResponseRequired(true);
|
||||||
|
oneway(info);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
onException(e);
|
onException(e);
|
||||||
}
|
}
|
||||||
@ -173,22 +175,34 @@ public class InactivityMonitor extends TransportFilter {
|
|||||||
commandReceived.set(true);
|
commandReceived.set(true);
|
||||||
inReceive.set(true);
|
inReceive.set(true);
|
||||||
try {
|
try {
|
||||||
if (command.getClass() == WireFormatInfo.class) {
|
if (command.getClass() == KeepAliveInfo.class) {
|
||||||
synchronized (this) {
|
KeepAliveInfo info = (KeepAliveInfo) command;
|
||||||
IOException error=null;
|
if (info.isResponseRequired()) {
|
||||||
remoteWireFormatInfo = (WireFormatInfo)command;
|
|
||||||
try {
|
try {
|
||||||
startMonitorThreads();
|
info.setResponseRequired(false);
|
||||||
|
oneway(info);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
error = e;
|
onException(e);
|
||||||
}
|
|
||||||
if( error!=null ) {
|
|
||||||
onException(error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
synchronized (readChecker) {
|
if (command.getClass() == WireFormatInfo.class) {
|
||||||
transportListener.onCommand(command);
|
synchronized (this) {
|
||||||
|
IOException error = null;
|
||||||
|
remoteWireFormatInfo = (WireFormatInfo) command;
|
||||||
|
try {
|
||||||
|
startMonitorThreads();
|
||||||
|
} catch (IOException e) {
|
||||||
|
error = e;
|
||||||
|
}
|
||||||
|
if (error != null) {
|
||||||
|
onException(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
synchronized (readChecker) {
|
||||||
|
transportListener.onCommand(command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user