?
Solved

SocketException:  Connection reset by peer: socket write error

Posted on 2002-03-21
5
Medium Priority
?
1,459 Views
Last Modified: 2008-03-10
I have a java based web server which streams data to an applet.  Occasionally the connection between the applet and server is broken.  the message on the server is SocketException: Connection reset by peer: socket write error.   After the connection is broke it appears the client side still thinks the connection is open and is blocking on a read.

The connection is a tunnel on port 80 which simulates a long file download.  Any ideas on what could cause the exception besides the obvious network error or the user closing the browser?  

I'm running JRE 1.2.2 on the server.  The applet is a standard applet under MSIE 5.5.
0
Comment
Question by:richp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 16

Accepted Solution

by:
heyhey_ earned 1200 total points
ID: 6886424
> The connection is a tunnel on port 80

is there a proxy between applet and server ?

Anyway you should ALWAYS track logical speed (i.e. check if there is data coming every 5 seconds) and close the connection if there is no new data. Some TCP implementations may report error after timeout of more than 10 minutes.
0
 

Author Comment

by:richp
ID: 6886452
Some clients use a proxy some do not.  

We send a heartbeat every 15 seconds so there should always be new data.
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 6886469
I have seen similar behaviour in various situations.
Connection in half-closed state (perfectly valid state according to the TCP RFC) may be caused by proxy, modem disconnection or various other communication problems.

The only possible solution is to start additional Thread that will check in new data is coming every 15 seconds and close the Socket if needed (this will unblock .read() operation)
0
 
LVL 9

Expert Comment

by:Venci75
ID: 7901124
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: heyhey_
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7962548
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question