I saw this in some official iOS apps, so I know it's possible and permitted.
I want to write a small socket server in iOS that some other application, that I will write for a desktop machine, can connect to and read data from.
Anyone did something like this and can help me with some clues or knows a good starting point ?
Socket.IO is a JavaScript library for real-time web applications(Instant messengers, Push Notifications, Online Gaming). Sockets have traditionally been the solution around which most real-time systems are architected, providing a bi-directional communication channel between a client and a server.
Using Socket.IOCreate a new Xcode project (File -> New -> Project). Select iOS e Single View App e click Next. Type a name for your project and click Next. Go to File -> Swift Packages -> Add Package Dependency…
Socket programming is a real-time, Bidirectional, Event-based communication. 1. Real-time:- Client will get the instant update when something happens on the server. 2. Bidirectional:- Client can both send and receive the update to the server.
At the basic level, the iphone communicates over the internet. The internet uses Internet Protocol, and there are two standard protocols built atop of IP: Transmission Control Protocol, and User Datagram Protocol. Each has it's own uses and functions. TCP/IP and UDP/IP make up the backbone of internet communication.
You should read the Stream Programming Guide, the WiTap sample, and many other Programming Guides, Samples and Documentation in Apple's Doc, you will find everything there (including detailed explanations and code)
If you simply go to the home page of iOS SDK documentation and go in the "Networking & Internet Topics" you have plenty of resources too, including the Network & Internet Starting Point guide and much more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With