1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

SMACK-412 Abstracted the keepalive implementation and set the thread to start and stop on demand.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_0@13610 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2013-04-16 01:39:17 +00:00
parent b4432d7627
commit 3a4b05ac00
6 changed files with 213 additions and 109 deletions

View file

@ -49,6 +49,7 @@ public class DummyConnection extends Connection {
private boolean authenticated = false;
private boolean anonymous = false;
private boolean reconnect = false;
private String user;
private String connectionID;
@ -71,6 +72,12 @@ public class DummyConnection extends Connection {
@Override
public void connect() throws XMPPException {
connectionID = "dummy-" + new Random(new Date().getTime()).nextInt();
if (reconnect) {
for (ConnectionListener listener : getConnectionListeners()) {
listener.reconnectionSuccessful();
}
}
}
@Override
@ -80,6 +87,11 @@ public class DummyConnection extends Connection {
roster = null;
authenticated = false;
anonymous = false;
for (ConnectionListener listener : getConnectionListeners()) {
listener.connectionClosed();
}
reconnect = true;
}
@Override