Using Network.framework TCP/TLS on iOS client. What should I use on Linux server?

Hi, everyone,



We're developing a client-server App under contract, the client to run on iOS 13 and the server on RedHat Linux (cloud).


Our App uses TCP/TLS streaming for real-time sync using a single JSON-encoded update object transfered between server and client in a very action game-like manner.


We've recently finished the network / communication implementation using Apple's new Network.framework and it is working like a charm: fast, reliable, secure.


The only problem now is: there doesn't seem to be a Network.famework implementation for Swift on Linux! Is that correct, or we just did not find it?


If indeed there is none, what would the Linux / SwiftNIO equivalent be for streaming TCP/TLS messages so we can keep the client code we already developed (and hope for an official implementation for Linux in the future)?


Looking back, we should have checked first, we just were to excited with NWframework 😉


Thanks! Tarq

Answered by DTS Engineer in 403841022

Is that correct … ?

That’s correct.

I’d use SwiftNIO for the Linux side of this, but I’m kinda biased. You could actually use SwiftNIO for both sides. On Apple platforms, SwiftNIO will use Network framework under the covers.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

Is that correct … ?

That’s correct.

I’d use SwiftNIO for the Linux side of this, but I’m kinda biased. You could actually use SwiftNIO for both sides. On Apple platforms, SwiftNIO will use Network framework under the covers.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for the prompt answer, eskimo,


Im a big fan of yours, BTW! See really helpful answers from you all the time 😎


One litlte extra help, if you can: most SwiftNIO tutorials I found so far seem to focus only on HTTPS post and/or websockets. Can you suggest any tutorials on SwiftNIO for data streams?


Something like WWDC's Tic-Tac-Toe example would be perfect, it really helped along with my coding!


Best, Tarq

Can you suggest any tutorials on SwiftNIO for data streams?

No, I’ve not played around with it in any depth, alas. My recommendation is that you bounce over to Swift Forums, and specifically Related Projects > SwiftNIO and ask there. The folks who work on it hang out there (-:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks, you're the best!


i Will do that 😊

Using Network.framework TCP/TLS on iOS client. What should I use on Linux server?
 
 
Q