从 Windows 调用 Linux 进程并接收 stdout

发布于 2024-07-10 14:20:43 字数 407 浏览 4 评论 0原文

我在我们公司有一个遗留应用程序,它构建在......咳咳; 经典 VB (VB 6)。 它有一个运行在 Linux 服务器上的优化器(CPLEX MIP Solver)组件,并用 Java 开发。

如果我们想提供一个Windows UI来调用远程Linux服务器上的优化器实例; 我应该如何实施?

优化器将发出有关其进度的消息,并且需要将其显示在 UI 上。

我现在想到了两个选择。

  1. 使用 PLINK 调用 linux 进程。 不确定是否可以将 STDOUT 带到 Windows。
  2. 构建一个小型 Java 应用程序并将其作为守护进程加载到 Linux 服务器上并通过 TCP 进行通信。

希望专家的建议。 感谢您伸出援助之手!

I have a legacy application in our company built on... ahem; Classic VB (VB 6).
It has got a optimizer(CPLEX MIP Solver) component running on a Linux server and is developed in Java.

If we want to provide a Windows UI to invoke the optimizer instance on a remote linux server; how should I implement it?

The optimizer will pump out messages about its progress and it needs to be displayed on the UI.

I thought of two options as of now.

  1. Invoke the linux process with PLINK. Not sure whether it can bring STDOUT to windows.
  2. Build a small java app and load it as a daemon on the linux server and communicate over TCP.

Would appreciate expert advise.
Thank for the helping hand!

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

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

发布评论

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

评论(3

秋千易 2024-07-17 14:20:43

您还可以使用 SSH 运行命令并捕获其输出,例如,对于 .NET
http://www.codeproject.com/KB/IP/sharpssh.aspx

您可以使用密钥自动执行登录过程。

You can also use SSH to run commands and capture their output, for example, for .NET
http://www.codeproject.com/KB/IP/sharpssh.aspx

You can automate the login process using keys.

水晶透心 2024-07-17 14:20:43

PLINK 选项是迄今为止最容易实现的(前提是您有类似于 系统的东西) () 在 Win32 API 中调用)

The PLINK option is by far rthe easiest to implement (provided you have something analogous to the system() call in the Win32 API)

陈年往事 2024-07-17 14:20:43

如果该组件是用 Java 编写的,为什么不在 Windows 上使用它呢? 如果不是,我误解你了,你有源代码吗? 如果是,只需将其复制到Windows并重新编译即可。 如果它确实是特定于 Linux 的,Cygwin 可能也是一个不错的选择。 但是,它仍然需要原始源代码。

If the component is written in Java, why don't you just use it on Windows? If it's not and I misunderstood you, do you have the source code? If yes, just copy it to Windows and recompile. If it really is Linux-specific, Cygwin might be a nice option too. However, it still requires the original source code.

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