简体   繁体   English

在iPhone上创建套接字服务器,而无需使用代理服务器或bonjour

[英]Create a socket server on an iPhone without using proxy server or bonjour

I want to transfer data from one iPhone to another using sockets. 我想使用套接字将数据从一部iPhone传输到另一部。

I have seen a lot of examples of connecting 2 iPhones together. 我已经看到了很多将两部iPhone连接在一起的示例。 either using sockets or using bonjour. 使用套接字或bonjour。 I don't want to connect the devices using bonjour. 我不想使用Bonjour连接设备。 For sockets, all examples I have encountered are using a server (non-ios device) for communication. 对于套接字,我遇到的所有示例都使用服务器(非ios设备)进行通信。

My question is: Can I create a socket server on an iOS device? 我的问题是:我可以在iOS设备上创建套接字服务器吗? If yes, can anyone share some pointers plz? 如果是,任何人都可以共享一些指针吗?

Found this library CocoaAsyncSocket . 找到了这个库CocoaAsyncSocket It has 2 example codes. 它有2个示例代码。 one, which creates a socket server on one device and the other which creates the socket client. 一个在一个设备上创建套接字服务器,另一个在一个设备上创建套接字客户端。

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

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