[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] HttpExchange questions


I have a few questions with the HttpClient and HttpExchange I hope someone can help me with. I'm using Jetty 7.4.2 on Android 2.3

1. I send a GET request to my server, intending to keep it open permanently. Every 70 seconds or so, my server sends a little packet. I set the timeout to 100 seconds  (via client.setTimeout(100000); ) but no matter what I set this value to, that is when onExpire() gets called. Is there some other setting I should set so that the receipt of the packet every 70 seconds resets this timer ?

2. Is it ok to use one single instance of HttpClient, and feeding it multiple HttpExchanges via the send() function ? The GET request I mentioned above times out (as mentioned above), so I call cancel() on 
it and create a new one, handing it to HttpClient via send() as before. However, I'm now getting the previous HttpExchange's data on the onResponseContent(). I'm not sure what I should be doing in an
individual HttpExchange's onResponseContent() - I just take the buffer as an array and copy it somewhere...

Any insight on these would be greatly appreciated