Solved

SocketException:  Connection reset by peer: socket write error

Posted on 2002-03-21
5
1,452 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 300 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

695 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