iPhone设备通过Wifi进行设备间通信 [英] iPhone Device to Device communication over Wifi

查看:54
本文介绍了iPhone设备通过Wifi进行设备间通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,例如一个iPhone设备充当服务器,几个iPhone设备充当客户端.我必须通过Wifi将客户端设备与服务器设备进行通信. 我该如何做到这一点.如果您能提供任何教程,将不胜感激. 在此先感谢.

I have requirement like, One iPhone Device acts as a server and several iPhone devices acts as a clients.I have to communicate the client devices to the Server Device over Wifi. How Can I achieve this. It would be appreciated if Could you provide any tutorial. Thanks in Advance..

推荐答案

!!!注意:
以下答案表明自iOS 7起不推荐使用的API.

!!! NOTE:
Below answer suggests an API that has been deprecated since iOS 7.

您正在查看 GKSession ..和项目.

you are looking at GKSession.. and this is an excellent and comprehensive tutorial for what you're looking for. IF you wanna dive a little deeper take a look at this project I made.

链接使用

the link in the comment above uses bonjour, which is a layer below GKSession (ie GKSession is a wrapper for bonjour).. so depending on how many devices you want to connect at a time (GKSession starts choking around 3-4) and how extensive your throughput/ping requirements are, you'd chose one or the other.

这篇关于iPhone设备通过Wifi进行设备间通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆