             })
         }
         else {
+            Logger.Debug("Send queue is empty, stopping to process")
             sendQueueProcessing = false
         }
         

    private func treatSendQueue() {
        dispatch_semaphore_wait(sendQueueLock, DISPATCH_TIME_FOREVER)
        if (self.sendQueue.count <= 0){
            sendQueueProcessing = false
            return
        }

    
    private func pingServerAfterInterval() {
        if status != .Connecting &&
           status != .Connected {
            Logger.Warning("Could not ping since we're not connected")
            return
        }
        
        nextPingTimeInterval = NSDate(timeIntervalSinceReferenceDate: NSDate.timeIntervalSinceReferenceDate().advancedBy(PING_SERVER_INTERVAL))
        let delayInSeconds = UInt64(PING_SERVER_INTERVAL + 1)
