[Xlightweb-develop] Incomplete body recieved
Status: Inactive
Brought to you by:
grro
|
From: Oladapo A. <ola...@ho...> - 2010-11-02 18:10:59
|
Hello All,
I need some help in relation to my xlightweb project i'm working on. I have a client request set to a jetty server using Continuation solution via HttpClient object like so:
IHttpRequest request = new PostRequest(url.toString(), JsonUtils.JSON_MIME_TYPE, httpMessageManager.encodeMessageToString((AbstractMessage) requestMessage)); httpClient.send(request, consumer);
The consumer an IHttpResponseHandler handles the response by reading content of the response and processing it's content like so:
int nBytes = response.getContentLength(); ByteBuffer byteBuffer = ByteBuffer.allocate(nBytes); int nBytesRead = response.getBody().read(byteBuffer);
if (nBytes == nBytesRead) { //do some work }else { throw new Exception("custom message"); }
It works fine when I call the response once but under load I find that the exception is thrown. I've checked if the response is chunked from the server side and is not the case. I have traced the responses and it seem that the OS is receiving the response, any ideas.
regards
Ola
|