swift - CocoaAsyncSocket: Error creating iOS UDP socket when dispatch_sync(socketQueue, block) is called -
i write ios swift app connects udp server locally. here code wrote using library called cocoaasyncsocket , when run it crash. i haven't found similar high level api in apple. thing found documentation suggest higher level api. would able point me towards better library or towards resolving bug get? import uikit import cocoaasyncsocket class outputsocket: nsobject, gcdasyncudpsocketdelegate { var serverip = "127.0.0.1" var port:uint16 = 10000 var socket:gcdasyncudpsocket! override init(){ super.init() setupconnection() } func setupconnection(){ socket = gcdasyncudpsocket(delegate: self, delegatequeue: dispatchqueue.main) { try socket.bind(toport: self.port) } catch { print("binding error: ", error.localizeddescription) } let addressdata = serverip.data(using: string.encoding.utf8) { try socket.connect(toaddress:...