What classes do I use to make an iPhone act as a server?

前端 未结 3 1477
遥遥无期
遥遥无期 2021-02-09 19:10

I\'m looking for an easy way for users to download content from an iPhone to their computer. I\'ve seen other apps that actually turn the iPhone into a server and give the user

3条回答
  •  深忆病人
    2021-02-09 20:06

    There is a good O'Reilly article on setting up a simple server.

    How to Write a Cocoa Web Server

    He uses NSFileHandle and NSSocketPort to setup a listener and handle requests. He also gets into some of the detail work of using the BSD sockets directly. I have had luck with this approach in the past.

    This was written back in 2006, and I haven't used this on an iPhone project yet, but the classes he uses are pretty common. I would give it a fighting chance of working for an iPhone project.

提交回复
热议问题