mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-27 00:32:07 +01:00
Temp fix for SSL exception problem until we finish final solution that consists of changing the keep alive thread to send a hearbeat when the connection is idle (i.e. nothing has been sent for a while). SMACK-141
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@3968 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
f7e4817f12
commit
6e49d6cb05
1 changed files with 12 additions and 3 deletions
|
@ -20,12 +20,15 @@
|
||||||
|
|
||||||
package org.jivesoftware.smack;
|
package org.jivesoftware.smack;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.io.*;
|
|
||||||
|
|
||||||
import org.jivesoftware.smack.filter.PacketFilter;
|
import org.jivesoftware.smack.filter.PacketFilter;
|
||||||
import org.jivesoftware.smack.packet.Packet;
|
import org.jivesoftware.smack.packet.Packet;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Writer;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes packets to a XMPP server. Packets are sent using a dedicated thread. Packet
|
* Writes packets to a XMPP server. Packets are sent using a dedicated thread. Packet
|
||||||
* interceptors can be registered to dynamically modify packets before they're actually
|
* interceptors can be registered to dynamically modify packets before they're actually
|
||||||
|
@ -432,6 +435,12 @@ class PacketWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
|
try {
|
||||||
|
// Sleep 15 seconds before sending first heartbeat. This will give time to
|
||||||
|
// properly finish TLS negotiation and then start sending heartbeats.
|
||||||
|
Thread.sleep(15000);
|
||||||
|
}
|
||||||
|
catch (InterruptedException ie) { }
|
||||||
while (!done) {
|
while (!done) {
|
||||||
synchronized (writer) {
|
synchronized (writer) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue