Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/main/java/ua/naiksoftware/stomp/HeartBeatTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private void checkServerHeartBeat() {
if (serverHeartbeat > 0) {
final long now = System.currentTimeMillis();
//use a forgiving boundary as some heart beats can be delayed or lost.
final long boundary = now - (3 * serverHeartbeat);
final long boundary = now - (1 * serverHeartbeat);
//we need to check because the task could failed to abort
if (lastServerHeartBeat < boundary) {
Log.d(TAG, "It's a sad day ;( Server didn't send heart-beat on time. Last received at '" + lastServerHeartBeat + "' and now is '" + now + "'");
Expand All @@ -149,8 +149,8 @@ private void checkServerHeartBeat() {
}
} else {
Log.d(TAG, "We were checking and server sent heart-beat on time. So well-behaved :)");
lastServerHeartBeat = System.currentTimeMillis();
}
this.scheduleServerHeartBeatCheck();
}
}

Expand Down