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

前端 未结 3 1476
遥遥无期
遥遥无期 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:01

    Cocoa provides lots of support for client-side networking but not a lot for server-side.

    At the lowest level, you can use normal BSD sockets.

    The next level up is CoreFoundation (plain C but using Cocoa-like types). Relevant CoreFoundation APIs are CFNetwork, CFSocket and CFStream (CFStream is a file-stream that can have its source through a network -- it is not a System V style network Stream).

    In Objective-C, you can look at NSStream which is the Objective-C equivalent of CFStream.

提交回复
热议问题