use of org.apache.openejb.client.FlushableGZIPOutputStream in project tomee by apache.
the class EjbDaemon method service.
public void service(final Socket socket) throws IOException {
InputStream in = null;
OutputStream out = null;
try {
if (socket.isClosed()) {
return;
}
socket.setSoTimeout(this.timeout);
if (gzip) {
in = new GZIPInputStream(new BufferedInputStream(socket.getInputStream()));
out = new BufferedOutputStream(new FlushableGZIPOutputStream(socket.getOutputStream()));
} else {
in = new BufferedInputStream(socket.getInputStream());
out = new BufferedOutputStream(socket.getOutputStream());
}
RequestInfos.initRequestInfo(socket);
service(in, out);
} finally {
if (null != out) {
try {
out.flush();
} catch (Throwable e) {
//Ignore
}
try {
out.close();
} catch (Throwable e) {
//Ignore
}
}
if (null != in) {
try {
in.close();
} catch (Throwable e) {
//Ignore
}
}
if (null != socket) {
try {
socket.close();
} catch (Throwable t) {
//Ignore
}
}
RequestInfos.clearRequestInfo();
}
}
Aggregations