Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Software caused connection abort when transferring File from java to android

 
Amit Shef
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.
 
Dave Tolls
Ranch Hand
Posts: 2103
15
  • 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
Ranch Hand
Posts: 2103
15
  • 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