使用 TCP/IP 发送数据包以在 XCode 中使用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13187706/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Sending Packets Using TCP/IP to Use in XCode
提问by DLieb
I'm very new to network programming, and would appreciate some help understanding what some good progress steps would be. I am designing an iOS app that requires real-time information to be delivered over a network from another machine. I know the IP address of this machine, as well as the API that the machine adheres to in terms of sending and receiving messages.
我对网络编程很陌生,希望得到一些帮助,了解一些好的进展步骤是什么。我正在设计一个 iOS 应用程序,它需要从另一台机器通过网络传送实时信息。我知道这台机器的IP地址,以及这台机器在发送和接收消息方面所遵循的API。
From doing some research, it seems like I need to open up a socket on one of the machine's ports, and open up another socket on my computer, and then use TCP/IP to send and receive packets between the two.
通过一些研究,我似乎需要在机器的一个端口上打开一个套接字,并在我的计算机上打开另一个套接字,然后使用 TCP/IP 在两者之间发送和接收数据包。
What is a good overview of the process that I need to do at this point? Which languages and environments would you suggest that would be most efficient for me to be able to get the information I need from this machine into my XCode project?
在这一点上我需要做的过程的一个很好的概述是什么?你会建议哪种语言和环境最有效地让我能够从这台机器获取我需要的信息到我的 XCode 项目中?
Thanks! Any help would be appreciated.
谢谢!任何帮助,将不胜感激。
采纳答案by rbp
you just need to look for examples of how to do "socket programming" for IOS. here's one resource:
您只需要查找如何为 IOS 进行“套接字编程”的示例。这是一个资源:
http://www.tekritisoftware.com/sites/default/files/Socket_Programing_for_IOS.pdf
http://www.tekritisoftware.com/sites/default/files/Socket_Programing_for_IOS.pdf