iPhone最好的方法来实现的设备到设备的通信 [英] iPhone best method to achieve device-to-device communication

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

问题描述

什么是实现一个应用程序中实时设备到设备通信的最佳方法?我一直在尝试与苹果推送通知服务,但发现它参差不齐最好的实时消息。有没有利用这个插座的方式还是我只是坚持到使用APNS?

What would be the best method to achieve realtime device to device communication within an application? I've been experimenting with the Apple Push Notification Service but find it spotty at best for realtime messaging. Is there a way to utilize sockets for this or am I just stuck into using the APNS?

推荐答案

如果你是一个初学者,使用的GameKit。

If you are a beginner, use GameKit.

当你生病的情况下,采用AsyncSocket。

When you get sick of that, use AsyncSocket.

的GameKit就是这么简单一个孩子可以使用它; AsyncSocket可能是在所有的任何平台上联网的最美丽的图书馆 - 非常容易使用。

GameKit is so simple a child can use it; AsyncSocket is probably the most beautiful library in all of networking on any platforms - incredibly easy to use.

在这两种情况下,你会首先使用的Bonjour(code两行)发现其它设备。

In both cases, you will first use Bonjour (two lines of code) to "find" the other device.

下面是完整的解释...
<一href=\"http://stackoverflow.com/questions/4050166/tabletipad-android-server-communication-protocol/4051556#4051556\">Tablet(iPad/Android)-Server通信协议

Here is the full explanation... Tablet(iPad/Android)-Server Communication Protocol

有关GK您需要的关键秘密知识......结果
客户端/服务器GKSessions

Critical secret knowledge about GK you will need...
Client/Server GKSessions

另一个快速汇总结果...
<一href=\"http://stackoverflow.com/questions/4269613/most-effective-way-to-do-networking-on-mac-iphone/4271926#4271926\">Most有效的方式做在Mac / iPhone的网络?

Another quick summary ...
Most effective way to do networking on Mac/iPhone?

有关记录,APNS有绝对没有任何关系与你想达到什么样的!全然忘了APNS。

For the record, APNS has absolutely nothing whatsoever to do with what you are trying to achieve! Utterly forget about APNS.

什么是RADIUS? -----------------------的 *

WHAT IS THE RADIUS? -----------------------*

请注意, 蓝牙只能在大约二十英尺。 (十几米。)

Please note that BLUETOOTH ONLY WORKS over about twenty feet. (Ten meters.)

请注意,对于本地WiFi连接,则必须都连接到相同的本地WiFi毂。 无线集线器有一系列的也许20米而已,说的是房子,只剩下一屋子(取决于墙壁有多厚的)。

Please note that for a local WiFi connection, you must both be connected to the same local WiFi hub. WiFi hubs have a range of perhaps 20 meters only, say one house and the next house only (depending on how thick the walls are).

请注意: IT实际上是不可能的连接两个计算机(任何类型)OVER MILES

Please note that: IT IS NOT PHYSICALLY POSSIBLE TO CONNECT TWO COMPUTERS (OF ANY TYPE) OVER A COUPLE OF MILES.

有没有这样的联网设备。 (也许你可以使用建说:业余无线电,但要清楚这将是会采取一个大公司年完成一个完全新的,新的研究项目之一。)

There is no such networking device. (You could perhaps build one using say "ham radio" but to be clear it would be a completely novel, new research project that would take a large company years to complete.)

有绝对没有的作品这样的 - 我很遗憾地告诉你一个坏消息

There is absolutely nothing that works like that - I'm sorry to tell you the bad news.

只有两个possibilties有蓝牙和WiFi,他们仅比分别为30脚长约20。工作

The ONLY two possibilties are Bluetooth and WiFi, and they work only over about 20 and 30 feet respectively.

那么,你如何连接两台远程计算机这样呢?答案是, 通过互联网

So how do you connect two remote computers like that? The answer is, via the internet.

做到这一点的唯一方法是与互联网连接。没有与任何现有的技术没有直接的连接成为可能。

The only way to do it is with an internet connection. There is no 'direct' connection possible with any existing technology.

如果您需要了解更多关于如何连接两台电脑使用互联网(比如两台iPhone),你可能会问一个新的问题! 你会很高兴地知道它是很容易的,会导致你有点麻烦

If you need to know more about how to connect two computers (say two iPhones) using the internet, you will probably have to ask a new question! You will be pleased to know it is very easy and will cause you little trouble.

请注意,这两个iPhone手机必须有一个良好的坚实的网络连接。如果他们比说彼此30英尺,只有这样,才能连接到iPhone手机是通过互联网。他们必须各自有一个良好的互联网连接,或者是没有可能。

Note that both iPhones MUST have a good solid internet connection. If they are more than say 30 feet away from each other, the ONLY way to connect to iPhones is via the internet. THey must each have a good internet connection, or there is no possibility.

我希望这有助于澄清事情!

I hope this helps clarify things!

这篇关于iPhone最好的方法来实现的设备到设备的通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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