是否有支持 Telnet RFC2217(通过网络连接与 COM 端口通信)的 Java 客户端?

发布于 2024-09-08 00:34:28 字数 1743 浏览 3 评论 0原文

这应该很简单,非常简单,但我很难做到。


问题
我正在寻找一个java开源项目,它将使用RFC2217协议进行通信。我发现 Java RFC2217 终端服务器并不缺乏,但我需要一个客户端。如果所有这些人都在编写服务器,那么就必须有人编写客户端!正确的?我只是在 java 中找不到一个。


背景
我们有一个硬件(SeaLINK+16 Ultra),物理连接到十几个串行设备并接受 TCP 网络连接来控制他们。该设备与具有虚拟 COM 端口的服务器联网,我们的应用程序使用该虚拟 COM 端口与这十几个设备进行通信。

基本上,我们的服务器最终将网络数据发送到该 SeaLINK 设备,该设备将 TCP 流量转换为 COM 数据,并通过串行将其传输到其连接的串行设备。服务器和 SeaLINK 设备使用 RFC2217 中指定的协议进行通信。

需要发送到这些串行设备的命令非常简单(Cisco IOS)。诸如“启用”、“写入内存”、“重新加载”等短字符串。

问题是,在我们的服务器上启用的虚拟 COM 端口需要的驱动程序在 Linux 中安装起来非常麻烦,而且不跨平台。另外,我们的整个应用程序都是用 Java 编写的,因此如果我们能找到一个可以“讲 RFC2217”的 java 网络包,我们就可以立即解决我们的问题,并且我们的应用程序不需要与驱动程序捆绑在一起。


总结
我需要做的就是将这些命令“包装”到符合 RFC2217 的 TCP 数据包中。应该有一个 java 客户端,您向它提供一个命令字符串,它会打开一个套接字并以符合 RFC2217 的方式传输您的字符。

这意味着,我不必在本地安装驱动程序或使用虚拟 COM 端口。我所要做的就是按照以下方式运行代码:

RFC2217Client magicJavaClient;

magicJavaClient.setServer("192.168.40.5");
magicJavaClient.setPort(4162);
magicJavaClient.connect();

magicJavaClient.send("enable");
magicJavaClient.send("write memory");    
magicJavaClient.close();

哎呀,我什至会满足于在本地创建虚拟COM端口的东西——只要它都是java的。像这样的 COM Redirector 正是我所需要的,但它是不在 Java 中。预先感谢您的任何和所有建议!

更新
NVTCom 似乎是基于java的RFC2217客户端的类型我正在寻找,但它的记录非常少,几乎无法使用。还有其他客户吗?我们甚至会考虑商业解决方案。

This should be simple, very simple, but I'm having a hard time with it.

Problem

I'm looking for an open source project, in java, that will communicate using the RFC2217 protocol. I find no shortage of Java RFC2217 Terminal Servers but I need a client. If all these people are writing servers, someone has to have written a client! Right? I just can't find one in java.

Context

We have a piece of hardware (SeaLINK+16 Ultra) that's physically connected to a dozen serial devices and accepts TCP network connections to control them. This device is networked with a server that has virtual COM ports that our application uses to communicate with those dozen devices.

Basically, our server ultimately sends network data to this SeaLINK device and this device converts the TCP traffic to COM data and transmits it via serial to its connected serial devices. The server and the SeaLINK device use the protocol specified in RFC2217 in order to communicate.

The commands that need to be sent to these serial devices are very simple (Cisco IOS). Short strings like "enable", "write memory", "reload", etc.

The issue is, the virtual COM ports enabled on our server require drivers that are a HUGE hassle to install in Linux and are not cross-platform. Plus, our entire application is written in Java so if we could just find a java networking package that can "speak RFC2217," we could solve our problems in no time and our application wouldn't need to be bundled with drivers.

Summary

All I need to do is "wrap" these commands into TCP packets that comply with RFC2217. There should be a java client out there somewhere that, you provide it a command string and it opens a socket and transmits your characters in a manner compiant with RFC2217.

Meaning, I wouldn't have to deal with installing drivers or using virtual COM ports locally. All I'd have to do is run code along the lines of:

RFC2217Client magicJavaClient;

magicJavaClient.setServer("192.168.40.5");
magicJavaClient.setPort(4162);
magicJavaClient.connect();

magicJavaClient.send("enable");
magicJavaClient.send("write memory");    
magicJavaClient.close();

Heck, I'd even settle for something that created virtual com ports locally--as long as it's all java. Something like this COM Redirector is exactly what I need but it's not in Java. Thanks in advance for any and all suggestions!

Update
NVTCom seems to be the type of java-based RFC2217 client I'm looking for but it's so poorly documented that it's almost unusable. Are there any other clients out there? We would even consider a commercial solution.

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

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

发布评论

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

评论(2

握住我的手 2024-09-15 00:34:28

每个人都在谈论天气,但没有人采取任何行动。
-- Mark Twain

我发现自己在寻找 Java RFC 2217 客户端库时遇到了同样的情况,但没有找到任何有用的东西。所以我决定尝试一下。

查看我的新 jvser 项目,如果您发现任何错误或想加入这一努力。

Everybody talks about the weather but nobody does anything about it.
-- Mark Twain

I found myself in the same boat looking for a Java RFC 2217 client library and finding nothing useful. So I decided to take a stab at it.

Check out my new jvser project and let me know if you find any bugs or would like to join the effort.

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