         
         if method == "SHOWPIN"
         {
+            pin = generatePin()
+            
+            print("pin \(pin)")
+            
             let ok:String = "HTTP/1.1 200 OK\r\n"
             
             guard

class MConnect2TCPDelegate:NSObject, GCDAsyncSocketDelegate
{
    var acceptedSocket:GCDAsyncSocket?
    
    func reply() -> Data
    {

        
        return compo2[0]
    }
    
    func generatePin() -> String
    {
        let numberFormatter:NumberFormatter = NumberFormatter()
        numberFormatter.maximumIntegerDigits = 8
        numberFormatter.minimumIntegerDigits = 8
        
        let random:UInt32 = arc4random_uniform(99999999)
        let number:NSNumber = random as NSNumber
        let string:String = numberFormatter.string(from:number)!
        
        return string
    }
}
