// // main.swift // Net1090 // // Created by Jacky Jack on 11/07/2024. // import Foundation import Network import NIO var timer: Timer? let ADSBClient = NetADSBDecoder(host: "192.168.7.61", port: 12345) print("Net1090") //var timer:Timer? timer = Timer.scheduledTimer( withTimeInterval: 1, repeats: true ) { _ in print("Timer drain queue") while let msg = ADSBClient.msgarray.pop() { print(msg) } } print("start") DispatchQueue.global(qos: .background).async { do { try ADSBClient.start() } catch let error { print("Error: \(error.localizedDescription)") ADSBClient.stop() } } RunLoop.current.run() print("end")