Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Software caused connection abort when transferring File from java to android  RSS feed

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm making a program which transfers a file. In the process of this method, I'm getting the written error:

"Connection reset by peer: socket write error" and "Software caused connection abort"

The file's size which I'm transferring is 96MB.

(clientSocket is SSLSocket)

Client:

Activity_1 Class:



Activity_2 Class:



Server:





Error on Server:






Error on Client:


What could cause this problem to occur?

Thanks in advanced.
 
Master Rancher
Posts: 3629
40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks like your Android client is timing out.

You can find the timeout setting for our Socket using the getSoTimeout() method and compare that to how long your download is taking.
 
Amit Shef
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:This looks like your Android client is timing out.

You can find the timeout setting for our Socket using the getSoTimeout() method and compare that to how long your download is taking.




Thanks for replying.


My socket has already a timeout for his connection (7 seconds), but it still does not help.
 
Dave Tolls
Master Rancher
Posts: 3629
40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How quickly does this timeout then?

Have you timed it (via logging possibly) from the opening of the connection in Activity_1 to the time out exception?
 
Amit Shef
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:How quickly does this timeout then?

Have you timed it (via logging possibly) from the opening of the connection in Activity_1 to the time out exception?



I set the Timeout at the beginning before I'm connecting to the socket.

For example:




I'm sorry for this inconvenience, but I don't know how to check how quickly will it timeout.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!