My code was working fine and I received data from the server but suddenly I got this error :
javax.net.ssl.SSLException: Read error: ssl=0x717c368708: I/O error during system call, Connection reset by peer
also sometimes I got this error :
com.google.gson.stream.MalformedJsonException:
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
I'm using retrofit
implementation 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
implementation 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
and here is the init for it
Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl).
addConverterFactory(GsonConverterFactory.create()).build();
Api api = retrofit.create(Api.class);
Call<ProfileResult> profileCallBack = api.getProfileData();