Does this happen depending on whether the user cancels the connection
during the previous run? If so, check how you cancel the connection.
If not, I don't have an explanation but have a suggestion: perhaps you
could try using DefaultHttpClient. It's a subclass of abstract
HttpClient, and provides a different way to work with http / https.
-- Kostya
28.09.2010 11:02, Lidia пишет:
Hello developers,
I have a very interesting situation.
My application have to check any time at start-up the update- if the
new version of itself exists.
In case it exists , it downloads it from an https://... web address,
and initiates an install action.
But if the user cancels the install, next time at the start-up the
application checks again for the update, and so on.
If i use HttpsURLConnection class (http secure):
HttpsURLConnection urlConnection =
(HttpsURLConnection)url.openConnection();
urlConnection.setHostnameVerifier( DO_NOT_VERIFY);
urlConnection.setRequestMethod("GET");
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
urlConnection.connect();
I have a strange bug, it is working good only every first and third
time,namely:
1. if i open the application and it founds that update exists. It
downloads new version and installs, but i choose cancel install.
2. if i open the app second time, i get the following error in this
line:
InputStream inputStream = urlConnection.getInputStream();
//EXCEPTION java.io.IOException: Read error: I/O error during system
call, Connection reset by peer
// java.io.IOException: Read error: I/O error during system call,
Connection reset by peer
// at
org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeread(Native
Method)
// at
org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.access
$200( OpenSSLSocketImpl. java:55)
// at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
$SSLInputStream.read( OpenSSLSocketImpl.java:514)
// ..................
and the file created to populate it with bytes from external file - is
null, it's length is "0".
3, when i open the app the 3th time, is working well, like 1th time
4 when i open the app the 4th time, i get the same error like in 2tm
time.
and so on.
Is it a bug from the Android sdk? and there is no any solution to
solve it?
But if i use the same thing with the class HttpURLConnection and
download the save file, using he path http:// (not the secure one), it
is working well any time.
Does anyone know why this happens?
Thanks
Lidia
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en