I use DefaultHttpClient to retrieve data from the server, but a NoHttpResponseException exception occurred sporadically.
I referenced this post link and
HttpProtocolParams.setUseExpectContinue(httpClient.getParams(), false);
not working for me.
I use HttpRequestRetryHandler to avoid this problem and it works, but I do not think this is the ideal method because the network data packet is dropped by tcpdump on the server side.
I found that when a NoHttpResponse exception occurs, the new port is used when connecting to the server instead of the old port used before this request (HttpClient does not reuse the old connection). But I did not find any tcp 3-way handhake data package when a new port from the client side connects to the server side. But based on tcp theory, shaking hands is a must when creating a new connection.
I don't know if this is an android bug (I use android 2.3 for testing), who has an idea? Thanks in advance.
source share