httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeraja Divakaruni <neeraja.divakar...@oracle.com>
Subject java.net.SocketException: socket write error (code=10053) on apache
Date Tue, 11 Jun 2002 12:05:21 GMT

Hi,

we have the following code in our application and it fails with
"java.net.SocketException: socket write error (code=10053)"  error when DATA
STRING which is the data to be written onto the socket exceeds 20 MB (to be
generic with large amounts of data)


socket = getConn(url.getHost(), url.getPort());

StringReader stringreader = new StringReader(DATA STRING);
OutputStreamWriter outputstreamwriter = new
OutputStreamWriter(socket.getOutputStream());
int i = 0;
int j = SystemProperties.SIZE_READBUF;
char ac[] = new char[j];
int k;
while(m_run && (k = stringreader.read(ac, 0, j)) > 0)
{
outputstreamwriter.write(ac, 0, k);
outputstreamwriter.flush();
i += k;
}

How ever if we establish the socket connection after reading the data into
the StringReader i.e with the following modification it works.


StringReader stringreader = new StringReader(DATA STRING);
socket = getConn(url.getHost(), url.getPort());
OutputStreamWriter outputstreamwriter = new
OutputStreamWriter(socket.getOutputStream());
int i = 0;
int j = SystemProperties.SIZE_READBUF;
char ac[] = new char[j];
int k;
while(m_run && (k = stringreader.read(ac, 0, j)) > 0)
{
outputstreamwriter.write(ac, 0, k);
outputstreamwriter.flush();
i += k;
}

What can be the reason for this. .Is it the limitation with apache or it is
some version related.Is there any way we can avoid this using some methods.
can any of you help me in identifying the issue.

Thanks
Neeraja

Mime
View raw message