Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-10-2008, 05:55 AM
Member
 
Join Date: Mar 2008
Posts: 1
kuguy is on a distinguished road
Software caused connection abort: socket write error
Hi all,

I have that "Software caused connection abort: socket write error" exception error that i've never meet before.

Basically what im trying to do is the following:
- a client connect to a server using sslsocket.
- server receive the connection and reply with the first part of the data and keep the connection open.
- then client receive the reply and request for another data using the same socket connection
- then server receive the next request and reply with the second part of the data and close the connection when the loop is finish.

what im trying to do is actually to chunk the download size. consider I need to download a 20MB of data from the server, using a single request is fine, but client have to wait for sometime until all the data is downloaded. so im trying to chunk the data into several part, and the server will send the chunk of data one by one. so the moment client receive the first part of the data, it will display it directly and at the same time will process the next data.

creating a new socket request for each chunk of data will be slow since it has to keep open and close the socket to server several times.

so in short, im trying to utilize one socket connection to do several data communication between client and server.
can you help point out what i did wrong in doing this..? or a link to any site providing example in doing this..?

Thanking you in advance for your help and sorry for the length of the post..


//server side
GZIPOutputStream gos = new GZIPOutputStream(child.getOutputStream());
GZIPInputStream gis = new GZIPInputStream(child.getInputStream());
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(gos,48000));
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(gis,48000));

out.writeObject( passRequest( obj ) );
out.flush();
gos.finish();
String sDate, eDate;

do{
gis = new GZIPInputStream(child.getInputStream());
in = new ObjectInputStream(new BufferedInputStream(gis,48000));
obj=in.readObject();

Vector<String> dates = (Vector<String>) ((CRequest) obj)
.getInfo();
String start = dates.get(0);
String end = dates.get(1);
SimpleDateFormat sdf = new SimpleDateFormat(
"MMM dd, yyyy hh:mm:ss a");
SimpleDateFormat sdf3 = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");

Date startD = null;
Date endD = null;

try {
startD = sdf.parse(start);
endD = sdf.parse(end);
} catch (ParseException e1) {

e1.printStackTrace();
}
sDate = sdf3.format(startD);
eDate = sdf3.format(endD);
gos = new GZIPOutputStream(child.getOutputStream());
out = new ObjectOutputStream(new BufferedOutputStream(gos,48000));
out.writeObject( passRequest( obj ) );
out.flush();
gos.finish();

}while(!sDate.equals(eDate));



//client side

sslFact = (SSLSocketFactory) SSLSocketFactory
.getDefault();
server = (SSLSocket) sslFact.createSocket(ip, port);
server.setEnabledCipherSuites(set);
server.setReceiveBufferSize(48000);
server.setSendBufferSize(48000);

Date currentEnd = GlobalMethods.sDate;
Date currentStart;
long period = 1000*60*60*6; //6 hours
long endTime = GlobalMethods.eDate.getTime();

//request splitted historical time until end date is reached
//if currentStart and currentEnd are equals, so it's the last request
while(currentEnd.getTime() < endTime){

currentStart = currentEnd;
long nextPeriod = currentStart.getTime() + period;
if(nextPeriod < endTime)
currentEnd = new Date(nextPeriod);
else
currentEnd = new Date(endTime);

dates.clear();
dates.add(currentStart.toLocaleString());
dates.add(currentEnd.toLocaleString());

creq = new CRequest(Activator.cookie,
RequestConstants.CMC_REQUEST_DATA, segment, dates,
ip, port);
gos = new GZIPOutputStream(server.getOutputStream());
out = new ObjectOutputStream(new BufferedOutputStream(gos, 48000));
// /* Can we actually send ourselves and then receive ourselves?*/
out.writeObject(creq);
out.flush();
gos.finish();
gis = new GZIPInputStream(server.getInputStream());
in = new ObjectInputStream(new BufferedInputStream(gis, 48000));
/* Returning the newly modified request with results */
final CRequest received = (CRequest) in.readObject();

PlatformUI.getWorkbench().getDisplay().asyncExec(
new Runnable() {
public void run() {
pref.processData((GeneralDataObj) received
.getInfo());
}
});
}




//server log error :

javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException:

java.net.SocketException: Software caused connection abort: socket write error
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEO F(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWr ite(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write (Unknown Source)
at java.util.zip.DeflaterOutputStream.deflate(Unknown Source)
at java.util.zip.DeflaterOutputStream.write(Unknown Source)
at java.util.zip.GZIPOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.d rain(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.s etBlockDataMode(Unknown

Source)
at java.io.ObjectOutputStream.writeNonProxyDesc(Unkno wn Source)
at java.io.ObjectOutputStream.writeClassDesc(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unk nown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeFatalException(Unk nown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at com.inetmon.jn.server.SessionManager.run(SessionMa nager.java:153)
Caused by: javax.net.ssl.SSLException: java.net.SocketException: Software caused

connection abort: socket write error
at com.sun.net.ssl.internal.ssl.Alerts.getSSLExceptio n(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(U nknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(U nknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleE xception(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleE xception(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write (Unknown Source)
at java.util.zip.DeflaterOutputStream.deflate(Unknown Source)
at java.util.zip.DeflaterOutputStream.write(Unknown Source)
at java.util.zip.GZIPOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.d rain(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.w rite(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unkn own Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unk nown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unkn own Source)
at java.io.ObjectOutputStream.defaultWriteObject(Unkn own Source)
at java.util.Vector.writeObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeWriteObject(Unknow n Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unk nown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unkn own Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unk nown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unkn own Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unk nown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
... 2 more
Caused by: java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at com.sun.net.ssl.internal.ssl.OutputRecord.writeBuf fer(Unknown Source)
at com.sun.net.ssl.internal.ssl.OutputRecord.write(Un known Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRe cord(Unknown Source)
... 34 more
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-20-2008, 11:44 PM
Member
 
Join Date: May 2008
Posts: 4
cdef218 is on a distinguished road
zjjuying2
Agree with your view, to support you斜流风机 管道风机 风机 风机厂 上虞风机
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-21-2008, 07:29 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,338
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Normally this error is occurred when you try to write some data from one end and at that time connection of the other side is closed. Debug and check what's going on there.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket vortex New To Java 2 05-25-2008 07:41 AM
File Write Error vikain Advanced Java 5 01-02-2008 05:38 AM
error I/O connection bbq Database 1 07-05-2007 02:33 PM
XML through a socket Heather XML 2 07-04-2007 10:31 AM
Struts tag error with bean:write sandor Web Frameworks 1 04-07-2007 05:50 AM


All times are GMT +3. The time now is 04:59 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org