allow a 0 closeTimeout to mean infinite, currently it turns the sync request into an async request

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1031761 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2010-11-05 20:05:18 +00:00
parent 2bdddc2021
commit b6a9c70ef0
1 changed files with 3 additions and 1 deletions

View File

@ -1318,7 +1318,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
private Response doSyncSendPacket(Command command, int timeout)
throws JMSException {
try {
Response response = (Response)this.transport.request(command, timeout);
Response response = (Response) (timeout > 0
? this.transport.request(command, timeout)
: this.transport.request(command));
if (response != null && response.isException()) {
ExceptionResponse er = (ExceptionResponse)response;
if (er.getException() instanceof JMSException) {