473,588 Members | 2,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Software caused connection abort: socket write error

2 New Member
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
GZIPOutputStrea m gos = new GZIPOutputStrea m(child.getOutp utStream());
GZIPInputStream gis = new GZIPInputStream (child.getInput Stream());
ObjectOutputStr eam out = new ObjectOutputStr eam(new BufferedOutputS tream(gos,48000 ));
ObjectInputStre am in = new ObjectInputStre am(new BufferedInputSt ream(gis,48000) );

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

do{
gis = new GZIPInputStream (child.getInput Stream());
in = new ObjectInputStre am(new BufferedInputSt ream(gis,48000) );
obj=in.readObje ct();

Vector<String> dates = (Vector<String> ) ((CRequest) obj)
.getInfo();
String start = dates.get(0);
String end = dates.get(1);
SimpleDateForma t sdf = new SimpleDateForma t(
"MMM dd, yyyy hh:mm:ss a");
SimpleDateForma t sdf3 = new SimpleDateForma t(
"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.printStackTr ace();
}
sDate = sdf3.format(sta rtD);
eDate = sdf3.format(end D);
gos = new GZIPOutputStrea m(child.getOutp utStream());
out = new ObjectOutputStr eam(new BufferedOutputS tream(gos,48000 ));
out.writeObject ( passRequest( obj ) );
out.flush();
gos.finish();

}while(!sDate.e quals(eDate));



//client side

sslFact = (SSLSocketFacto ry) SSLSocketFactor y
.getDefault();
server = (SSLSocket) sslFact.createS ocket(ip, port);
server.setEnabl edCipherSuites( set);
server.setRecei veBufferSize(48 000);
server.setSendB ufferSize(48000 );

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

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

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

dates.clear();
dates.add(curre ntStart.toLocal eString());
dates.add(curre ntEnd.toLocaleS tring());

creq = new CRequest(Activa tor.cookie,
RequestConstant s.CMC_REQUEST_D ATA, segment, dates,
ip, port);
gos = new GZIPOutputStrea m(server.getOut putStream());
out = new ObjectOutputStr eam(new BufferedOutputS tream(gos, 48000));
// /* Can we actually send ourselves and then receive ourselves?*/
out.writeObject (creq);
out.flush();
gos.finish();
gis = new GZIPInputStream (server.getInpu tStream());
in = new ObjectInputStre am(new BufferedInputSt ream(gis, 48000));
/* Returning the newly modified request with results */
final CRequest received = (CRequest) in.readObject() ;

PlatformUI.getW orkbench().getD isplay().asyncE xec(
new Runnable() {
public void run() {
pref.processDat a((GeneralDataO bj) received
.getInfo());
}
});
}




//server log error :

javax.net.ssl.S SLException: Connection has been shutdown: javax.net.ssl.S SLException:

java.net.Socket Exception: Software caused connection abort: socket write error
at com.sun.net.ssl .internal.ssl.S SLSocketImpl.ch eckEOF(Unknown Source)
at com.sun.net.ssl .internal.ssl.S SLSocketImpl.ch eckWrite(Unknow n Source)
at com.sun.net.ssl .internal.ssl.A ppOutputStream. write(Unknown Source)
at java.util.zip.D eflaterOutputSt ream.deflate(Un known Source)
at java.util.zip.D eflaterOutputSt ream.write(Unkn own Source)
at java.util.zip.G ZIPOutputStream .write(Unknown Source)
at java.io.Buffere dOutputStream.f lushBuffer(Unkn own Source)
at java.io.Buffere dOutputStream.w rite(Unknown Source)
at java.io.ObjectO utputStream$Blo ckDataOutputStr eam.drain(Unkno wn Source)
at java.io.ObjectO utputStream$Blo ckDataOutputStr eam.setBlockDat aMode(Unknown

Source)
at java.io.ObjectO utputStream.wri teNonProxyDesc( Unknown Source)
at java.io.ObjectO utputStream.wri teClassDesc(Unk nown Source)
at java.io.ObjectO utputStream.wri teOrdinaryObjec t(Unknown Source)
at java.io.ObjectO utputStream.wri teObject0(Unkno wn Source)
at java.io.ObjectO utputStream.wri teFatalExceptio n(Unknown Source)
at java.io.ObjectO utputStream.wri teObject(Unknow n Source)
at com.inetmon.jn. server.SessionM anager.run(Sess ionManager.java :153)
Caused by: javax.net.ssl.S SLException: java.net.Socket Exception: Software caused

connection abort: socket write error
at com.sun.net.ssl .internal.ssl.A lerts.getSSLExc eption(Unknown Source)
at com.sun.net.ssl .internal.ssl.S SLSocketImpl.fa tal(Unknown Source)
at com.sun.net.ssl .internal.ssl.S SLSocketImpl.fa tal(Unknown Source)
at com.sun.net.ssl .internal.ssl.S SLSocketImpl.ha ndleException(U nknown Source)
at com.sun.net.ssl .internal.ssl.S SLSocketImpl.ha ndleException(U nknown Source)
at com.sun.net.ssl .internal.ssl.A ppOutputStream. write(Unknown Source)
at java.util.zip.D eflaterOutputSt ream.deflate(Un known Source)
at java.util.zip.D eflaterOutputSt ream.write(Unkn own Source)
at java.util.zip.G ZIPOutputStream .write(Unknown Source)
at java.io.Buffere dOutputStream.f lushBuffer(Unkn own Source)
at java.io.Buffere dOutputStream.w rite(Unknown Source)
at java.io.ObjectO utputStream$Blo ckDataOutputStr eam.drain(Unkno wn Source)
at java.io.ObjectO utputStream$Blo ckDataOutputStr eam.write(Unkno wn Source)
at java.io.ObjectO utputStream.def aultWriteFields (Unknown Source)
at java.io.ObjectO utputStream.wri teSerialData(Un known Source)
at java.io.ObjectO utputStream.wri teOrdinaryObjec t(Unknown Source)
at java.io.ObjectO utputStream.wri teObject0(Unkno wn Source)
at java.io.ObjectO utputStream.wri teArray(Unknown Source)
at java.io.ObjectO utputStream.wri teObject0(Unkno wn Source)
at java.io.ObjectO utputStream.def aultWriteFields (Unknown Source)
at java.io.ObjectO utputStream.def aultWriteObject (Unknown Source)
at java.util.Vecto r.writeObject(U nknown Source)
at sun.reflect.Gen eratedMethodAcc essor1.invoke(U nknown Source)
at sun.reflect.Del egatingMethodAc cessorImpl.invo ke(Unknown Source)
at java.lang.refle ct.Method.invok e(Unknown Source)
at java.io.ObjectS treamClass.invo keWriteObject(U nknown Source)
at java.io.ObjectO utputStream.wri teSerialData(Un known Source)
at java.io.ObjectO utputStream.wri teOrdinaryObjec t(Unknown Source)
at java.io.ObjectO utputStream.wri teObject0(Unkno wn Source)
at java.io.ObjectO utputStream.def aultWriteFields (Unknown Source)
at java.io.ObjectO utputStream.wri teSerialData(Un known Source)
at java.io.ObjectO utputStream.wri teOrdinaryObjec t(Unknown Source)
at java.io.ObjectO utputStream.wri teObject0(Unkno wn Source)
at java.io.ObjectO utputStream.def aultWriteFields (Unknown Source)
at java.io.ObjectO utputStream.wri teSerialData(Un known Source)
at java.io.ObjectO utputStream.wri teOrdinaryObjec t(Unknown Source)
at java.io.ObjectO utputStream.wri teObject0(Unkno wn Source)
... 2 more
Caused by: java.net.Socket Exception: Software caused connection abort: socket write error
at java.net.Socket OutputStream.so cketWrite0(Nati ve Method)
at java.net.Socket OutputStream.so cketWrite(Unkno wn Source)
at java.net.Socket OutputStream.wr ite(Unknown Source)
at com.sun.net.ssl .internal.ssl.O utputRecord.wri teBuffer(Unknow n Source)
at com.sun.net.ssl .internal.ssl.O utputRecord.wri te(Unknown Source)
at com.sun.net.ssl .internal.ssl.S SLSocketImpl.wr iteRecord(Unkno wn Source)
... 34 more
Mar 10 '08 #1
0 5881

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

Similar topics

3
50768
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 validate certificate chains
17
3232
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 connection string' . When I write the string to the page using response.write(connectionstring) it shows up fine. Is the something else that I need to do? Thanks
11
2749
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 halted. If a socket is no longer in the configuration, that thread must be aborted and the socket must be closed. After the configuration is complete, the remaining threads must be resumed. I currently have the following architecture:
0
4998
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; --> com.mysql.jdbc.PreparedStatement@1f11507: select news_id,DATE_FORMAT(news_date ,'%d %m %y')as Hmerominia , news_title, news_decr from news sql error:java.sql.SQLException: Communication link failure: java.net.SocketException, underlying cause: Software caused connection...
0
2036
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
12747
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 whether to accept(read) the body. if server decided to throw(dump) the request's body, it'll send back a response message, such as "resource already exists" and close the connection.
2
12056
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: Software caused connection abort: socket write error . If any body knows ,When this exception occurs Plase give me solution for the above problem asap. Thanks & Regards Siva
11
10797
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: http://www.nabble.com/Testing-for-Internet-Connection-tp18460572p18460572.html Sent from the Python - python-list mailing list archive at Nabble.com.
0
7929
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7860
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
7984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8223
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6634
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5726
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3847
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3883
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2371
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.