         let message = "<thread thread=\"\(server.thread)\" res_from=\"-\(resFrom)\" version=\"20061206\"/>"
         self.sendMessage(message)
         
+        self.startPingTimer()
+
         while self.inputStream != nil {
             self.runLoop.runUntilDate(NSDate(timeIntervalSinceNow: NSTimeInterval(1)))
         }

    
    var inputStream: NSInputStream?
    var outputStream: NSOutputStream?
    
    var parsingString: NSString = ""
    

    func closeSocket() {
        fileLog.debug("closed streams.")
        
        self.stopPingTimer()

        self.inputStream?.delegate = nil
        self.outputStream?.delegate = nil
        
