     return button
   }()
   func close() {
+    socketUdp.close()
+    socketTcp.disconnect()
     dismiss(animated: true, completion: nil)
   }
   

  var currentSocketMode: SocketMode = .UDP {
    didSet {
      if currentSocketMode == .UDP {
        self.socketTcp.disconnect()
      } else {
        self.reconnectTcp()
      }
    }
  }

        let portTF = alertController.textFields![1] as UITextField
        self.host = hostTF.text ?? "192.168.2.3"
        self.port = ((portTF.text ?? "6666") as NSString).integerValue
        self.reconnectTcp()
        UserDefaults.standard.set(self.host, forKey: HOST)
        UserDefaults.standard.set(self.port, forKey: PORT)
    }
