我使用什么类来使iPhone作为服务器? [英] What classes do I use to make an iPhone act as a server?
问题描述
我正在寻找一个简单的方法,用户从iPhone下载内容到他们的计算机。我看到其他应用程序,实际上把iPhone变成服务器,并给用户一个IP地址导航到他们的计算机上。我已经看过一些苹果的样本,但没有看起来太像我想要的。
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 an IP address to navigate to on their computer. I've glanced at some Apple samples, but nothing looked too much like what I was going for.
那么什么是最简单的方法使服务器监听TCP端口80(更好,HTTP服务器)并发送响应?希望使用Objective C类,但如果没有可用的东西,我可以创建一个包装。
So what's the easiest way to make a server that listens on TCP port 80 (even better, an HTTP server) and sends responses? Hopefully using Objective C classes, but I can make a wrapper if there isn't anything available.
推荐答案
Google Toolbox for Mac 有一个类型为 GTMHTTPServer 。
Deusty Designs有一个名为 CocoaHTTPServer 的项目, a>。
Deusty Designs has a project called CocoaHTTPServer.
您不能使用端口80,因为它需要root访问权限。
You can't use port 80 because it requires root access.
这篇关于我使用什么类来使iPhone作为服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!