Post

Replies

Boosts

Views

Activity

Reply to Should one use NWListener? POSIX Address already in use
That's an interesting thought. But that didn't work. What I can say though, is that I can start and stop the server how many times I want, it will work fine. But if I connect as a client to the server and then stop it, I will run into this POSIX Issue. This doesn't happen if I use UDP, btw. If I use the UDP Protocol, I don't recall running into this issue. Only TCP. Since there's a character limit on the forum: https://github.com/karl-police/ios_app_mic_pc_test/blob/main/iOS%20Mic%20Test/Include/TCPServer.swift https://github.com/karl-police/ios_app_mic_pc_test/blob/e9c633f4d9dcd7a402a07922800ed7ead743fa7c/iOS%20Mic%20Test/ViewController.swift#L396
2w
Reply to Should one use NWListener? POSIX Address already in use
I believe so? My issue doesn't happen if I change the port from TCP to UDP. It seems to happen whenever I call NWConnection.receive, to receive from a target connection. I also use the stateUpdateHandler as the callback instead to check if .ready to then process the connection. Maybe I should try the other way. Also is there a specific reason for let listener = self.listenerQ or is it just for better optional type handling? What I am actually doing, is that I don't even re-call .start but instead I re-use the constructor the server does trigger .cancel() so I am expecting to be able to re-construct it at any times I think?
2w
Reply to Should one use NWListener? POSIX Address already in use
func cancelConnection(_ connection: NWConnection) { if let index = self.connectionsArray.firstIndex(where: { $0 === connection }) { self.connectionsArray.remove(at: index) } connection.cancel() } func stopServer() { for connection in self.connectionsArray { self.cancelConnection(connection) // This closes the connection } self.listener?.cancel() //self.listener?.stateUpdateHandler = nil //self.listener?.newConnectionHandler = nil //self.listener = nil }
3w
Reply to I don't know how I can test my Testing App on my iPhone anymore
[quote='806386022, darkpaw, /thread/764956?answerId=806386022#806386022, /profile/darkpaw'] If you do not pay the annual Developer Fee, any apps you write can only be deployed to your device(s) and must be re-deployed every week. [/quote] That sounds fine. [quote='806386022, darkpaw, /thread/764956?answerId=806386022#806386022, /profile/darkpaw'] You've said you have had troubles creating a Developer Account but you don't say what the issues were? How do you expect us to help you if you don't provide this basic information? [/quote] Well, when I click "Enroll" you are given options e.g. Individual and etc. some require a D-U-N-S Number, but that's a business related thing. If I click on Individual it just tells me that I can't enroll at the time. [quote='806386022, darkpaw, /thread/764956?answerId=806386022#806386022, /profile/darkpaw'] I find it weird that you've never used Xcode but you've written an app for iOS. How are you deploying it to your iPhone? [/quote] gh-actions an alternative would also be .NET MAUI for cross-platform also with gh-actions
Sep ’24