使用 Objective-c 打开 TCP 套接字 [英] Open TCP Socket with Objective-c

查看:67
本文介绍了使用 Objective-c 打开 TCP 套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Objective-C创建TCP套接字,检查服务器上是否打开了某些TCP端口?

How to create a TCP socket using Objective-C, check if some TCP ports are opened on the server?

我尝试使用一些教程,但没有奏效,因为我需要使用 IP (198.168.0.000) 创建服务器,而不是一些博客文章使用的网站,例如 paypal.com.

I tried using some tutorials but none worked, because I need to create a server using an IP (198.168.0.000) and not a site, such as paypal.com, as some blog posts use.

我对使用哪个类以及如何使用感到有些困惑.我知道这不是最好的询问地点,但不知道在哪里搜索.

I'm a little confused about which class to use and how to use. I know that is not the best place to ask, but do not know where to search.

感谢您的帮助!

推荐答案

为此我推荐 CocoaAsyncSocket种工作.您可以手动完成,但如果您在 ObjC 中工作,那么 CocoaAsyncSocket 是一个更好的接口.

I recommend CocoaAsyncSocket for this kind of work. You can do it by hand, but if you're working in ObjC, then CocoaAsyncSocket is a much nicer interface.

这篇关于使用 Objective-c 打开 TCP 套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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