mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 10:49:41 +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:
parent
b4432d7627
commit
3a4b05ac00
6 changed files with 213 additions and 109 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue