SwiftOSC icon indicating copy to clipboard operation
SwiftOSC copied to clipboard

Support Swift Package Manager

Open Joebayld opened this issue 5 years ago • 18 comments

Hi,

Is there plans to make a Package.swift and support SPM? It shouldn't be too difficult - just some moving of files to respective folders. I can make a PR if needed.

Joebayld avatar Aug 25 '20 23:08 Joebayld

Sounds good to me. Any help is appreciated.

On Aug 25, 2020, at 4:15 PM, Joebayld [email protected] wrote:

Hi,

Is there plans to make a Package.swift and support SPM? It shouldn't be too difficult - just some moving of files to respective folders. I can make a PR if needed.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ExistentialAudio/SwiftOSC/issues/50, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDIQEMM32ILNRY7I6G7GJLSCRA2XANCNFSM4QLFYANA.

devinroth avatar Aug 25 '20 23:08 devinroth

Cool.

I hit a wall with the ysocket as it's using C code. I believe this is still possible to use - but might be worth shifting to a pure swift socket. There's a lot available now with the Networking framework so maybe that's an option.

Joebayld avatar Aug 26 '20 00:08 Joebayld

I had started to switch over to the Switch Networking Framework a while ago but had a number of issues. I believe it’s still in the dev branch if you want to take a look. It’s been over a year now so maybe they’ve improved a few things. Maybe it’s worth taking a look at that.

On Aug 25, 2020, at 5:12 PM, Joebayld [email protected] wrote:

Cool.

I hit a wall with the ysocket as it's using C code. I believe this is still possible to use - but might be worth shifting to a pure swift socket. There's a lot available now with the Networking framework so maybe that's an option.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ExistentialAudio/SwiftOSC/issues/50#issuecomment-680335695, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDIQEIZLK4M3Z6O3TPECQDSCRHP3ANCNFSM4QLFYANA.

devinroth avatar Aug 26 '20 00:08 devinroth

I'll give it a look. There's also https://github.com/robbiehanson/CocoaAsyncSocket which is a reputable networking library and also works nicely with SPM.

Joebayld avatar Aug 26 '20 00:08 Joebayld

I think in general I would prefer to go 100% swift going forward. I’m not opposed to using CocoaAsyncSocket if it’s a simple plug and play but if we’re going spending any time making it work I think it would be better spent just using the Swift Network Framework.

I'll give it a look. There's also https://github.com/robbiehanson/CocoaAsyncSocket https://github.com/robbiehanson/CocoaAsyncSocket which is a reputable networking library and also works nicely with SPM.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ExistentialAudio/SwiftOSC/issues/50#issuecomment-680361314, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDIQEKBHHH4EQ3LDZBOEWLSCRJ5NANCNFSM4QLFYANA.

devinroth avatar Aug 26 '20 01:08 devinroth

Hey Devin,

is there a chance for you to remember what the issues where with the Networking Framework? I had problems with the master branch (high cpu usage, server process was not stoped properly when my app was in the background, etc.) which where all gone once I decided to give the implementation in your dev branch a chance. Did not notice any issues so far (only in the simulator)

mk-conn avatar Dec 30 '20 22:12 mk-conn

No. I don’t remember.

But you say it’s working well. That’s good. Keep me updated if you run into any bugs. On Dec 30, 2020, 2:34 PM -0800, Marko Krüger [email protected], wrote:

Hey Devin, is there a chance for you to remember what the issues where with the Networking Framework? I had problems with the master branch (high cpu usage, server process was not stoped properly when my app was in the background, etc.) which where all gone once I decided to give the implementation in your dev branch a chance. Did not notice any issues so far (only in the simulator) — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

devinroth avatar Dec 30 '20 22:12 devinroth

Hey Devin,

is there a chance for you to remember what the issues where with the Networking Framework? I had problems with the master branch (high cpu usage, server process was not stoped properly when my app was in the background, etc.) which where all gone once I decided to give the implementation in your dev branch a chance. Did not notice any issues so far (only in the simulator)

wonder if this is related to #56

jcurtis-cc avatar Jan 28 '21 07:01 jcurtis-cc

I believe the primary reason for not releasing was because I was way too ahead of the curve. Apple had just released the Networking Framework and not many devices supported it and it was only available on the latest OSes. So please give it a spin. If successful I will release it.

Devin On Jan 27, 2021, 11:49 PM -0800, J Curtis [email protected], wrote:

Hey Devin, is there a chance for you to remember what the issues where with the Networking Framework? I had problems with the master branch (high cpu usage, server process was not stoped properly when my app was in the background, etc.) which where all gone once I decided to give the implementation in your dev branch a chance. Did not notice any issues so far (only in the simulator) wonder if this is related to #56 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

devinroth avatar Jan 28 '21 07:01 devinroth

@mk-conn any update on the dev branch? Any issues that you came across? If not I'll look into merging it into the master.

devinroth avatar Jan 29 '21 06:01 devinroth

@devinroth Noticed sometimes nw_listener_socket_inbox_create_socket setsockopt SO_NECP_LISTENUUID failed [2: No such file or directory] and nw_protocol_get_quic_image_block_invoke dlopen libquic failed but I have no clue if this is related to an issue in your code or a problem NWListener/NW protocols... It does not happen all the time and its not really reproducible (it seems)

mk-conn avatar Jan 30 '21 02:01 mk-conn

Thanks for the update. How often does that happen?

Devin On Jan 29, 2021, 6:15 PM -0800, Marko Krüger [email protected], wrote:

@devinroth Noticed sometimes nw_listener_socket_inbox_create_socket setsockopt SO_NECP_LISTENUUID failed [2: No such file or directory] and nw_protocol_get_quic_image_block_invoke dlopen libquic failed but I have no clue if this is related to an issue in your code or a problem NWListener/NW protocols... It does not happen all the time and its not really reproducible (it seems) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

devinroth avatar Jan 30 '21 15:01 devinroth

Since the last Xcode update pretty much on every try to start the simulator, which is making the simulator unusable. On a real device there are other errors coming up, like this:

 [connection] nw_endpoint_handler_create_from_protocol_listener [C3 192.168.178.27:63357 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, scoped, ipv4, ipv6, dns)] nw_endpoint_flow_pre_attach_protocols

 [connection] nw_connection_create_from_protocol_listener_on_nw_queue [C3] Failed to create connection from listener
 [] nw_ip_channel_inbox_handle_new_flow nw_connection_create_from_protocol_listener_on_nw_queue failed

But not every time the app is run and also not reproducable.

mk-conn avatar Jan 30 '21 22:01 mk-conn

Thanks. I'll try to tackle this when I get a chance.

devinroth avatar Jan 30 '21 22:01 devinroth

So... got some news on the simulator issue: turns out, when you run the app, the simulator has focus, the network connections does not come up with the errors I told above - click some where in the editor in Xcode - the network connection is established. I'm heavily confused now but I'm still not thinking your code is responsible for that. ;)

mk-conn avatar Feb 02 '21 13:02 mk-conn

Run a test on your phone. Run the app and establish connection, make sure it works, then put the phone on airplane mode.

Devin On Feb 2, 2021, 5:02 AM -0800, Marko Krüger [email protected], wrote:

So... got some news on the simulator issue: turns out, when you run the app, the simulator has focus, the network connections does not come up with the errors I told above - click some where in the editor in Xcode - the network connection is established. I'm heavily confused now but I'm still not thinking your code is responsible for that. ;) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

devinroth avatar Feb 02 '21 17:02 devinroth

Hi, I checked out dev branch for the last weeks with my small app. It runs fine here. It can also use Bonjour. SPM support worked without moving files, it's enough to specify the sources path in package.swift

soundflix avatar Nov 21 '21 23:11 soundflix

This would be great to add. I just spent more time wrangling cocoa pods than is worth the effort. Now to write the package.swift myself, but would be awesome to just include it.

onehundredfeet avatar May 31 '23 18:05 onehundredfeet