简体   繁体   English

iOS中通过wifi的点对点网络

[英]Peer-to-peer network over wifi in iOS

I've been at this for a few days now, and can't seem to find a solution. 我已经在这几天了,似乎无法找到解决方案。 I want to create a peer to peer network over wifi on iOS. 我想在iOS上通过wifi创建点对点网络。 All open source code seems to be supporting running a server or being a client, but there's no code built to support being both - a peer. 所有开源代码似乎都支持运行服务器或作为客户端,但是没有构建代码来支持两者 - 一个对等体。 Is anybody aware of a way I can do this? 有人知道我可以这样做吗?

iOS 7正是为此目的添加了多重连接框架

Have you thought of using Apple's GameKit framework? 你有没有想过使用Apple的GameKit框架? I've used it in the past for some simple communication between devices. 我过去曾用它来进行设备之间的简单通信。 It's really simple and can get you out of the gate quickly. 这很简单,可以让你快速走出大门。 This looks like a good tutorial. 看起来像一个很好的教程。

I think Open Peer is the right solution. 我认为Open Peer是正确的解决方案。 It provides real direct peer-to-peer connection between devices without the need of a centralised server. 它在设备之间提供真正的直接对等连接,而无需集中式服务器。 Check out this introductory video . 看看这个介绍性的视频

You cannot create a wi-fi network programmatically in iOS using current APIs. 您无法使用当前API在iOS中以编程方式创建Wi-Fi网络。 GameKit offers some APIs to do so over bluetooth however. GameKit提供了一些通过蓝牙实现的API。

If you wish to implement a custom solution using CocoaHTTPServer, be aware that you will still not be able to create a direct wi-fi connection, you will simply be able to connect devices on the same (pre-existing) wi-fi network. 如果您希望使用CocoaHTTPServer实现自定义解决方案,请注意您仍然无法创建直接的Wi-Fi连接,您只需连接相同(预先存在的)Wi-Fi网络上的设备即可。

Ad-hoc peer to peer Wi-Fi (such as 802.11s) in iOS is still a few years off. iOS中的Ad-hoc点对点Wi-Fi(例如802.11s)仍然需要几年的时间。 Maybe iOSX ;) 也许是iOSX;)

iOS supports the Multipeer Connectivity framework which enables iOS devices to talk to each other over Bluetooth, infrastructure (with a router) WiFi, or P2P. iOS支持Multipeer Connectivity框架 ,使iOS设备可以通过蓝牙,基础设施(使用路由器)WiFi或P2P进行相互通信。

It does not, however, provide a way to explicitly use P2P. 但是,它没有提供明确使用P2P的方法。 There is a layer of abstraction away from how any of a device's peers (other iOS devices) are connected, and it does not currently allow for non-iOS devices to be connected. 与设备的任何对等设备(其他iOS设备)的连接方式相比,有一层抽象,目前它不允许连接非iOS设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM