-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
in order to control when to update the client interface faster or slower depending when was the last time that the client browser asked for changes through "zkau" servlet, Is there any way to know from the Desktop or the Page Composer when was the last time the client asked for updates?
I know you can configure the min, max and ratio in zk.xml, but in my application is interesting to know it due to it's architecture.
Regards,
Vicente
You can implement EventInterceptor (refer to Performance Monitoring/Event Interceptors and EventInterceptor) or use a filter to detect zkau request then put the time into session and try to get it from Composer.
Regards,
Ben
Hi Ben,many thanks.
I've used a filter because it fits better with our development, the eventinterceptor produced thousands of events .
In the Thread I've added:
((HttpSession)dekstop.getSession().getNativeSession()).getLastAccessedTime()
to compare with the current time, and stop the thread whenever the difference is great enough.
But now I've seen that the browser keeps requesting "zkau" servlet until the end of the world, and I'll like to stop it after a server not answers during some time.
Do you know if there's any response code to say to the ZK javascript client to stop asking to the server , if it has been more than X seconds asking (I'll put it in the servlet filter), like this:
((HttpServletResponse)response).sendError(408);
I've done some tests and after a two minutes browser disconnections , the ZK client browser sends several "zkau" requests at the same second.
Many thankx,
Vicente
Is there any timer, server push or keep-alive setting (refer to http://books.zkoss.org/wiki/ZK%20Configuration%20Reference/zk.xml/The%20session-config%20Element ) ? You can try to remove timer/server push and set timer-keep-alive to false to confirm the cause.
benbai ( 2013-07-01 14:40:54 +0800 )editHi again Ben. I'll use the session-config/session-timeout element instead, together with the session's getLastAccessedTime(). By the way, the session-timeout does not times-out as expected, it takes a aleatory time to disconnect as said here: http://forum.zkoss.org/question/77589/session-timeout-pro
cocoes ( 2013-07-01 15:50:50 +0800 )editAsked: 2013-05-24 14:09:01 +0800
Seen: 25 times
Last updated: Jul 01 '13