Hi! I'm trying to write a simple server application. It must be able to serve a big entity (about 45kb) to the client, which is a JBoss Application Server in my case. Sending the entity results in a connection reset. I'm not sure why this happens. Maybe the client side input buffer is not big enough, so the client closes the connection.
This is what I use: HttpResponse response = new BasicHttpResponse(statusLine); //set the header with response.addHeader(...); StringEntity entity = new StringEntity(data, encoding); response.setEntity(entity); serverConnection.sendResponseHeader(response); serverConnection.sendResponseEntity(response); If I use a very simple client app which just opens a socket and prints all received data to the console, everything looks right. I also sniffed the communication between the JBoss and another server which serves the same data as I would like to serve. This data is sent in many small chunks (<500 bytes). If I shorten the data to that size, everything works (beside the data which is missing, of course). I also tried to use chunked transfer coding but since the ChunkedOutputStream.write does not split the data, nothing changes. So, the main question is: How do I send a large entity in small chunks? Or did I miss something else? Thanks in advance for every help / comment! Best regards, Malte --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
