[xSocket-develop] HttpClien problems
Status: Inactive
Brought to you by:
grro
|
From: Masar <ma...@Ma...> - 2008-07-18 12:54:04
|
Hi Gregor, I did some test with your library and found it very useful. In the attach you can find a sample HttpClient I did to test the lib: feel free to include it in the library if you think it could be useful as a sample. Now I can tell you the problems I found; I did my tests on Linux with Sun java version "1.6.0_06", xSocket-2.1.jar, xSocket-http-2.0-beta-1.jar 1) When I do httpClient.close() some TCP connections are non closed immediately but remain connected to the remote hosts for about 40 seconds (see *2). If I use the non pooled version httpClient.setPooled(false) I do not have the problem. 2) If there is an host that is non existant (es: www.asdasdadasdasdasdasd.com) the problem is worst, all the connections are not closed. 3) If there is a non responding host (es: http://www.google.com:81) I cannot control the TCP timeout because it seems I have no access to the HttpClientConnection to set the parameter SO_TIMEOUT. Next two wishes: 1) It could be useful to have an Attachment in the HttpClient send, that I could retrieve from IHttpResponseHandler, this would let me use a single instance of IHttpResponseHandler instead of one for each Request. HttpClient void send(IHttpRequest request, IHttpResponseHandler responseHandler, Object oAttachment) IHttpResponseHandler void onResponse(IHttpResponse response, Object oAttachment) void onException(IOException ioe, Object oAttachment) 2) I don't like annotations used to modify a function mode of operation, because they are difficult to document and easily to forget, I would prefer a flag in HttpClient to specify the InvokeOn mode of operation. Thanks Maurizio Sartori |