Commit fdf3ed27 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Modified to reuse the same factory for all the connections. JM-167


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@977 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4c928967
......@@ -44,6 +44,10 @@ public class SocketReadThread extends Thread {
* The utf-8 charset for decoding and encoding Jabber packet streams.
*/
private static String CHARSET = "UTF-8";
/**
* Reuse the same factory for all the connections.
*/
private static XmlPullParserFactory factory = null;
private Socket sock;
private Session session;
......@@ -58,9 +62,18 @@ public class SocketReadThread extends Thread {
*/
private Auditor auditor;
private boolean clearSignout = false;
XmlPullParserFactory factory = null;
XPPPacketReader reader = null;
static {
try {
factory = XmlPullParserFactory.newInstance();
}
catch (XmlPullParserException e) {
Log.error("Error creating a parser factory", e);
}
}
/**
* Create dedicated read thread for this socket.
*
......@@ -86,9 +99,6 @@ public class SocketReadThread extends Thread {
*/
public void run() {
try {
factory = XmlPullParserFactory.newInstance();
// factory.setNamespaceAware(true);
reader = new XPPPacketReader();
reader.setXPPFactory(factory);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment