mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01:00
Use Asyn.go() to create and start reader thread
in XMPPTCPConnection.
This commit is contained in:
parent
ed84b4a8b3
commit
04d47b2dda
1 changed files with 3 additions and 7 deletions
|
@ -69,6 +69,7 @@ import org.jivesoftware.smack.tcp.sm.packet.StreamManagement.StreamManagementFea
|
||||||
import org.jivesoftware.smack.tcp.sm.predicates.Predicate;
|
import org.jivesoftware.smack.tcp.sm.predicates.Predicate;
|
||||||
import org.jivesoftware.smack.tcp.sm.provider.ParseStreamManagement;
|
import org.jivesoftware.smack.tcp.sm.provider.ParseStreamManagement;
|
||||||
import org.jivesoftware.smack.util.ArrayBlockingQueueWithShutdown;
|
import org.jivesoftware.smack.util.ArrayBlockingQueueWithShutdown;
|
||||||
|
import org.jivesoftware.smack.util.Async;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smack.util.TLSUtils;
|
import org.jivesoftware.smack.util.TLSUtils;
|
||||||
|
@ -910,8 +911,6 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
|
|
||||||
protected class PacketReader {
|
protected class PacketReader {
|
||||||
|
|
||||||
private Thread readerThread;
|
|
||||||
|
|
||||||
XmlPullParser parser;
|
XmlPullParser parser;
|
||||||
|
|
||||||
private volatile boolean done;
|
private volatile boolean done;
|
||||||
|
@ -925,14 +924,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
void init() throws SmackException {
|
void init() throws SmackException {
|
||||||
done = false;
|
done = false;
|
||||||
|
|
||||||
readerThread = new Thread() {
|
Async.go(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
parsePackets();
|
parsePackets();
|
||||||
}
|
}
|
||||||
};
|
}, "Smack Packet Reader (" + getConnectionCounter() + ")");
|
||||||
readerThread.setName("Smack Packet Reader (" + getConnectionCounter() + ")");
|
|
||||||
readerThread.setDaemon(true);
|
|
||||||
readerThread.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue