如何通过封闭网络搜索特定计算机?
我有一个由 16 台计算机组成的网络,全部连接到同一交换机,但未连接到互联网。 16 台计算机中的一台运行着一个小型 Java 应用程序以及 BlazeDS 服务器(也称为侦听端口上的消息)。
目前,其他 15 台“客户端”计算机必须手动输入 java 应用程序所在的“服务器”IP。我的客户端应用程序是 Adobe Air,因此我没有扫描服务器的能力。
我正在考虑用 Java 或 C++ 编写一个帮助应用程序/实用程序。至少,这个应用程序可以向用户显示 IP,然后用户可以将其输入到 Air 应用程序中;草率但总比没有好。
我确信有一些工具可以解决此类问题。有什么想法吗?
I have a network of 16 computers all linked to the same switch, not connected to the internet. One of the 16 computers has a small Java app running on it along with a BlazeDS server (aka it's listening on a port for a message).
Currently, the other 15 "client" computers have to manually enter the "server" IP where the java app resides. My client app is Adobe Air, so I have no abilities there as far as scanning for the server.
I was thinking of writing a helper app / utility in Java or C++. At the very least, this app could display the IP to the user who could then input it into the Air app; sloppy but better than nothing.
I'm sure there are some tools out there that deal with this type of problem. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我强烈建议为此使用 Zeroconf/Bonjour,因为它可以轻松处理去中心化的“我应该了解的其他人和我应该了解的其他人在哪里”?
在 Java 中(并且完全在您自己的应用程序中)执行此操作的最简单方法是使用 jmdns 项目。 http://jmdns.sourceforge.net/
I would strongly recommend using Zeroconf/Bonjour for this as it makes it trivially easy to handle decentralized "where is the others who I should know about and should know about me"?
The easiest way to do this in Java (and completely inside your own application) is with the jmdns project. http://jmdns.sourceforge.net/
您可以为用户编写一个“发现”功能,该功能向当前计算机的同一子网中的所有 IP 地址发送心跳或测试消息,以查找适当接受/响应的服务器。
You could code a "discover" feature for the users that sends a heartbeat or test message to all the IP addresses in the same subnet of the current computer looking for the server that accepts / responds appropriately.
简而言之,nmap。您可以告诉它扫描网络块
请参阅http://nmap.org/
In a word, nmap. You can tell it to scan a netblock
See http://nmap.org/
Adobe AIR 2.0(以测试版形式提供)能够与本机进程进行通信。请参阅 http://www.adobe.com/devnet/air/flex /quickstart/interacting_with_native_process.html
您可以使用此工具来调用您编写并随应用程序一起提供的帮助程序。该助手将使用一些方法来发现您的服务器。例如zeroConf Networking(Apple 称为Bonjour)。然后,您的 AIR 应用程序将使用从帮助程序收到的地址来建立与服务器的连接。
Adobe AIR 2.0 (available as Beta) has the ability to communicate with native processes. See http://www.adobe.com/devnet/air/flex/quickstart/interacting_with_native_process.html
You can use this facility to call a helper that you write and ship with your app. This helper would use some means of discovering your server. For instance zeroConf Networking (called Bonjour by Apple). Your AIR app would than use the address it received from the helper to make a connection to the server.
多播可以工作 - 如果您对 java 感到满意,http://www.jgroups.org 怎么样
multicast would work - how about http://www.jgroups.org if you are happy with java