如何编写 iPhone 应用程序来控制公开 telnet api 的设备

发布于 2024-08-23 15:29:18 字数 500 浏览 4 评论 0原文

我必须编写一个控制设备的 iPhone 应用程序。该设备公开了基于 telnet 的接口。理想情况下,应用程序应该为每个用户提供用户访问控制和可定制性。

我正在考虑编写 C++ 类来使用套接字与设备进行通信。然后可以通过 iPhone 应用程序调用的 Web 服务公开此功能。

然而,当我深入研究时,API 允许您使用 telnet 注册事件,然后您可以在这些事件发生时收到通知。这对我来说有点麻烦。我不知道“推送”方案可以与网络服务一起使用。

首先,到目前为止我还没有为 iPhone 编程过。所以我不太确定可以做什么。所以我在想,为什么不让应用程序在 iPhone 上独立运行,使用套接字直接与设备通信,而不是通过网络服务器。但问题是,这是否可能,其次我认为这会引起安全方面的问题。首先,我们可以控制安全性,因为一切都通过我们的中央服务器进行。有没有一种方法可以在没有中央服务器的情况下处理安全性(即谁有权访问设备)。

很抱歉,这看起来像是一篇杂乱无章的帖子,但我想在这里集思广益。

期待听到您的意见。

I have to write an iphone application that controls a device. This device exposes a telnet based interface. The application should ideally have user access control and customizability for each user.

I was thinking of writing C++ classes that would communicate with the device using sockets. This functionality can then be exposed through web-services that can be called by the iphone application.

However as i looked into it deeper, the api allows you to register for events using telnet and then you can receive notification when those events occur. That kinda put a spanner in the works for me. I for one dont know a "push" scenario can work with webservices.

First off i have never programmed for the iphone so far. So i am not really sure what can be done. So i was thinking if instead of having a webserver to go through, why not have the application independently running on the iphone, directly communicating with the device using sockets. The question though is, is that possible and second i am thinking it would raise a security aspect. First we could control security as everything was going through our central server. Is there a way to handle security (in the sense who has access to the device) without having a central server.

I am sorry that this seems like an unorganized post, but iam trying to brainstorm here.

Looking forward to hear your opinions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

皓月长歌 2024-08-30 15:29:18

查找 NSPortNSStream 类。

Look up the NSPort and NSStream classes.

夏日落 2024-08-30 15:29:18

我想做同样的事情。有一个程序在一台计算机上运行,​​并且想要从 iOS 发送/接收 telnet 命令。使用 Commons 库为 Android 构建了一个 - 它有一个 telnet 客户端 API,但不知道在 Objective-C 中执行此操作的最佳方法(无需编写 telnet 客户端库)。

不过,首先,我在 Google 代码上找到了 OFC 库。看起来有点像 Commons 的感觉,而且似乎有一个 telnet 客户端。你可能会看一下。

I'm looking to do this same thing. Have a program running on one computer and want to send/receive telnet commands from iOS. Built one for Android using the Commons library- which has a telnet client API, but don't know the best way to do it in Objective-C (without writing a telnet client library).

As a start, however, I found the OFC library on Google Code. Looks like something of a Commons-like feel, and there seems to be a telnet client. You might take a look at that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文