Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Jarrod Parkes
Courses Plus Student 10,884 PointsDevelop iOS Client/Server Application
Disclaimer: Yes, I have read and implemented Ray Wenderlich's client/server example found here http://www.raywenderlich.com/3932/how-to-create-a-socket-based-iphone-app-and-server
My question is slightly different. Obviously, there are many iOS applications/examples that act as a client; however, would it be possible to create a very simple server application which physically runs on a iOS device (phone/tablet)?
Furthermore, could you write a pair of iOS applications (a client app and a server app) to demonstrate a client/server system on one device?
(I understand that this is not the conventional method for such as a task, this is more for sake of example and understanding iOS device boundaries)
Thanks, Jarrod
1 Answer
Amit Bijlani
Treehouse Guest TeacherYou can build an iPhone app that runs a server but it would only be active while the app is open since you cannot have background processes running. Although, there are very limited use cases for doing such a thing.
Jarrod Parkes
Courses Plus Student 10,884 PointsJarrod Parkes
Courses Plus Student 10,884 Points@Amit: Thank you for the quick response. This verifies what I needed to know. The question stems from a college networking assignment which asks to create simple TCP/IP client/server program(s). It sounds like it is safe to say that iOS applications are almost always built as client applications where the server backend is housed elsewhere.
Jarrod Parkes
Courses Plus Student 10,884 PointsJarrod Parkes
Courses Plus Student 10,884 Points(Also, is there a way for me to delete the accidental answer below? I meant for that to be a response to your answer)
Ben Jakuben
Treehouse TeacherBen Jakuben
Treehouse TeacherI think posts can only be deleted by staff and moderators. I deleted yours for you. :)
Jarrod Parkes
Courses Plus Student 10,884 PointsJarrod Parkes
Courses Plus Student 10,884 Pointsthat works. thanks!