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:
Gaston Dombiak 2006-06-09 23:24:54 +00:00 committed by gato
parent f7e4817f12
commit 6e49d6cb05
1 changed files with 12 additions and 3 deletions

View File

@ -20,12 +20,15 @@
package org.jivesoftware.smack;
import java.util.*;
import java.io.*;
import org.jivesoftware.smack.filter.PacketFilter;
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
* interceptors can be registered to dynamically modify packets before they're actually
@ -432,6 +435,12 @@ class PacketWriter {
}
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) {
synchronized (writer) {
try {