You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by "Schreier, Balz" <Ba...@sunrise.net> on 2003/11/14 18:38:14 UTC

sockets not closed

hi,

I experienced the following problem (with both version: 1.1 and 1.2-b2):

I only use asynchronous calls.
In order to extend java.net.URLConnection by a connection timeout I
implemented a timeout mechanism around the asynchronous call.
When the request times out, a new XmlRpcClient is created for the next call.

In the code of XmlRpcClient I found the following:

                XmlRpc.XmlWriter xmlwriter = new XmlRpc.XmlWriter(this,
buffer);
                writeRequest(xmlwriter, s, vector);
                xmlwriter.flush();
                byte abyte0[] = buffer.toByteArray();
                URLConnection urlconnection = url.openConnection();
                urlconnection.setDoInput(true);
                urlconnection.setDoOutput(true);
                urlconnection.setUseCaches(false);
                urlconnection.setAllowUserInteraction(false);
                urlconnection.setRequestProperty("Content-Length",
Integer.toString(abyte0.length));
                urlconnection.setRequestProperty("Content-Type",
"text/xml");
                if(auth != null)
                    urlconnection.setRequestProperty("Authorization", "Basic
" + auth);
                OutputStream outputstream = urlconnection.getOutputStream();
                outputstream.write(abyte0);
                outputstream.flush();
                outputstream.close();
                java.io.InputStream inputstream =
urlconnection.getInputStream();
                parse(inputstream);

why is the inputstream not closed?

I noticed, that the socket connections are not closed after a request.

Does anybody have indepth knowledge in this field here?
thanks for any hints,
cheers
balz