Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a small (socket) server in iOS

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 ?

like image 877
Nicu Surdu Avatar asked Oct 02 '11 12:10

Nicu Surdu


People also ask

What are sockets in iOS?

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.

How Socket is implemented in iOS?

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…

What is Socket programming in Swift?

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.

How does iOS App communicate with 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.


Video Answer


1 Answers

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.

like image 145
AliSoftware Avatar answered Sep 27 '22 22:09

AliSoftware