diff --git a/source/org/jivesoftware/smack/PacketWriter.java b/source/org/jivesoftware/smack/PacketWriter.java
index <HASH>..<HASH> 100644
--- a/source/org/jivesoftware/smack/PacketWriter.java
+++ b/source/org/jivesoftware/smack/PacketWriter.java
@@ -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 {
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-<I>

git-svn-id: <URL>