Atmosphere/atmosphere — Issue #82: Problem with IE9 connection closed
Author: agolebiowski
Created: 2011-11-26 19:20:54+00:00
State: open

I have a problem with atmosphere framework -> Firefox and Chrome, Internet Explorer 7 everything works perfect but with Internet Explorer 9 connection is closed after few secconds with warning (sorry for polish language in error message;):

HTML1113: Ponowne uruchomienie trybu dokumentu od Standardy programu IE9 do Quirks
DsGate?_=1322334258838

. Project source in attachment. Project written in grails 1.3.7 with using http://www.grails.org/plugin/atmosphere.

Configuration:

atmospherePlugin {
servlet {
// Servlet initialization parameters
// Example: initParams = ['org.atmosphere.useNative': 'true', 'org.atmosphere.useStream': 'false']
initParams = []
urlPattern = '/atmosphere/*'
}
handlers {
// This closure is used to generate the atmosphere.xml using a MarkupBuilder instance in META-INF folder
atmosphereDotXml = {
//'atmosphere-handler'('context-root': '/atmosphere/chat', 'class-name': 'com.odelia.grails.plugins.atmosphere.ChatAtmosphereHandler')
}
}
}

test.html

OK

OK

Service:

class DsGateService {

static transactional = false
static atmosphere = [mapping: '/atmosphere/DsGate']
private final static String JUNK = """\
\n"""

def onRequest = { event ->
println('DsGateService::onRequest()')
event.response.with {
setContentType("text/html;charset=ISO-8859-1")
addHeader("Cache-Control", "private")
addHeader("Pragma", "no-cache")
// TODO To revisit (necessary with Atmosphere 0.6.1?)
// For IE, Safari and Chrome, we must output some junk to enable streaming
10.times { writer.write(JUNK) }
writer.flush()
}
// Mark this connection as suspended.
event.suspend()
event.response.with {
status = 422
writer.write "success"
writer.flush()
}
}

def onStateChange = { event ->
println( "onStateChange, message");
if (!event.message) return
if (event.isResuming() || event.isResumedOnTimeout()) {
event.resource.response.writer.with {
write("");
flush()
}
}
else{
println('1.->'+event.message)
event.resource.req.session;
event.resource.response.writer.with {
write("${event.message}");
flush();
}
}
}
}