option to set session "wait" time or time out

  2 posts   Feedicon  
Replies: 1 - Last Post: September 18, 2011 04:43
by: reddiraju
showing 1 - 2 of 2
 
Posted: September 16, 2011 10:36 by reddiraju
BOSHClientConfig or BOSHClient class does not provide to set the session "Wait" attribute, it is hard coded to 60 (60 * 1000), is there valid reason behind it?

one of the reason to use jbosh is to connect and keep live for long time and continues.
 
Posted: September 18, 2011 04:43 by reddiraju
I initial thought client is not receiving responses and get terminated by server due to wait, I notice a bug in the ”BOSHClient” it could not send the update acknowledgement id, hence for the new response id is attached with old or first created acknowledgement id, on the XMPP server side performers check on dispatching the response to client by getting the response based on acknowledge id, if response is older than “xxxx” milliseconds then it raises the terminate response, so in this cases XMPP server raises the terminate response because the fetched response for acknowledgement id, as it was older. On correction on ”BOSHClient” to send the acknowledge id equal to response id or less than one then it processing was proper, I am still in processing of test.

Summary:
The response form XMPP seems to be solved based on client correction to send latest acknowledge id.


Old Code:

/**
* Process the response in order to update the response acknowlegement
* data.
*
* This method assumes the lock is currently held.
*
* @param req request
*/
private void processResponseAcknowledgementData(
final AbstractBody req) {
assertLocked();

Long rid = Long.parseLong(req.getAttribute(Attributes.RID));
if (responseAck.equals(Long.valueOf(-1L))) {
// This is the first request
responseAck = rid;
} else {
pendingResponseAcks.add(rid);
// Remove up until the first missing response (or end of queue)
Long whileVal = responseAck;
while (whileVal.equals(pendingResponseAcks.first())) {
responseAck = whileVal;
pendingResponseAcks.remove(whileVal);
whileVal = Long.valueOf(whileVal.longValue() + 1);
}
}
}


Changed Code:

/**
* Process the response in order to update the response acknowlegement
* data.
*
* This method assumes the lock is currently held.
*
* @param req request
*/
private void processResponseAcknowledgementData(
final AbstractBody req) {
assertLocked();

Long rid = Long.parseLong(req.getAttribute(Attributes.RID));
if (responseAck.equals(Long.valueOf(-1L))) {
// This is the first request
responseAck = rid;
pendingResponseAcks.add(rid);//Add the request id to pending acks
} else {
// pendingResponseAcks.add(rid);
// Remove up until the first missing response (or end of queue)
Long whileVal = responseAck;
while (pendingResponseAcks.size() > 0 && whileVal.equals(pendingResponseAcks.first())) {
pendingResponseAcks.remove(whileVal);
whileVal = Long.valueOf(whileVal.longValue() + 1);
responseAck = whileVal; //add the latest request id

}
//moved the adding request id so that all previous are cleared
pendingResponseAcks.add(rid);
}
}
Replies: 1 - Last Post: September 18, 2011 04:43
by: reddiraju
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close