any examples of a server/client iphone app where both the server and clients are iOS devices?

早过忘川 提交于 2019-12-06 14:13:47

问题


I would like to create a server/client application where one iphone is running a server, and all other devices on the same wifi network can connect to the server device and send and receive information. Are there any examples of running a server on a device and letting other devices on the network search for it?

I looked into using GameKit, but the 16 person max limit is unfortunate. cocoaasyncsocket seems like a good option, but how do I set up one device as the server, and search for it on other devices?


回答1:


The WiTap sample code may be what you're looking for (or at least a good place to start):

http://developer.apple.com/library/ios/#samplecode/WiTap/Introduction/Intro.html



来源:https://stackoverflow.com/questions/8114865/any-examples-of-a-server-client-iphone-app-where-both-the-server-and-clients-are

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!