473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Software caused connection abort: socket write error

2
Hi all,

I'm new to the forums, so I hope this isn't in the wrong place...

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
Mar 10 '08 #1
0 5837

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Janwillem Borleffs | last post by:
Hello everybody, Using the following snippet: <snippet> System.setProperty("javax.net.ssl.trustStore", "/var/keystores/somehost.keystore"); // Create a trust manager that does not...
17
by: AMC | last post by:
Hi, I'm using an include file to store the connection string to a database. Whenever I try to reference that string to open a connection in the page that includes the file I get the error 'empy...
11
by: Keith Langer | last post by:
I have an application which consists of a main work thread and multiple threads which each maintain a TCP socket. When a configuration change occurs, all activity on the socket threads must be...
0
by: Theodore | last post by:
Hello to everybody i am new to this forum and i have an important problem with sql statements in my website. why do i get these error messages , can anybody tell me; -->...
0
by: rocky9999 | last post by:
hi, i have one problem. when i go to indiatimes chat room after loading jave applet its giving prolem software caused connection abort recv failed. can any one give me solution for this. thanks
14
by: ahlongxp | last post by:
Hi, everyone, I'm implementing a simple client/server protocol. Now I've got a situation: client will send server command,header paires and optionally body. server checks headers and decides...
2
by: isnr42 | last post by:
Hi , I am getting the following exception While inserting the data into the database. SQL Exception is occurred while getting the Next value of the Sequence java.sql.SQLException: Io exception:...
11
by: Alexnb | last post by:
Hello internet. I am wondering, is there a simple way to test for Internet connection? If not, what is the hard way :p -- View this message in context:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.