Reputation: 345
Long polling interval in atmosphere framework is about 60 secs. Even after setting pollingInterval attribute in AtmosphereRequest, the request is sent to server after 60 secs. How exactly to set the pollingInterval in the request?
This is the request in javascript:
request : {
url : document.location.toString() + 'echo',
transport : 'websocket',
fallbackTransport : 'long-polling',
trackMessageLength : true,
reconnect: true,
pollingInterval :10,
maxReconnectOnClose: Number.MAX_VALUE,
reconnectInterval: 10,
connectTimeout: -1
}
Upvotes: 3
Views: 2328
Reputation: 94
On the server side, in the web.xml, you could set these two init-param entries:
<init-param>
<param-name>org.atmosphere.cpr.AtmosphereInterceptor</param-name>
<param-value>org.atmosphere.interceptor.HeartbeatInterceptor</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.interceptor.HeartbeatInterceptor.heartbeatFrequencyInSeconds</param-name>
<!-- value in seconds, default 60 -->
<param-value>10</param-value>
</init-param>
For more information:http://atmosphere.github.io/atmosphere/apidocs/org/atmosphere/interceptor/HeartbeatInterceptor.html
Upvotes: 4