     }
     
     func close() {
+        self.pingTimer?.invalidate()
+        self.pollingTimer?.invalidate()
+        
         if websocketConnected {
             self.ws?.send(PacketType.MESSAGE.rawValue + PacketType.CLOSE.rawValue)
             self.ws?.close()
         }
     }
     
-    private func createURLs(params:[String: AnyObject]? = nil) -> (NSURL, NSURL) {
+    private func createURLs(params:[String: AnyObject]? = nil) -> (String, String) {
         var url = "\(self.client.socketURL)/socket.io/?transport="
         var urlPolling:String
         var urlWebSocket:String
+        let time = Int(NSDate().timeIntervalSince1970 * 1000)
         
         if self.client.secure {
             urlPolling = "https://" + url + "polling"

    
    private func upgradeTransport() {
        if self.websocketConnected {
            self.ws?.send(PacketType.UPGRADE.rawValue)
        }
    }


class SocketEngine: NSObject, SRWebSocketDelegate {
    unowned let client:SocketIOClient
    private let pollingQueue = NSOperationQueue()
    private var pingTimer:NSTimer?
    private var pollingTimer:NSTimer?
    private var _polling = true
    private var _websocket = false
    private var websocketConnected = false
