[英]How to discover all other instances of my application on the local Windows network?
We want to add a 'collaborative' feature to our application, so our program should be able to automatically discover all other instances of itself that are running on the same local network, without needing any extra configuration from the users. 我们希望向我们的应用程序添加“协作”功能,因此我们的程序应该能够自动发现运行在同一本地网络上的其他所有实例,而无需用户进行任何额外配置。
Our application runs on Windows, so it can use any APIs provided by the OS. 我们的应用程序在Windows上运行,因此可以使用操作系统提供的任何API。 We are assuming a network typical for a small business, a couple of Windows PCs, some routers, etc.
我们假设一个小型企业的典型网络,几台Windows PC,一些路由器等。
Also, will there be problems with anti-viruses, firewalls, and such? 另外,防病毒软件,防火墙等是否会出现问题? We don't want to scare our users.
我们不想吓users我们的用户。
You can send broadcast packets for that but that only works within a single subnet (actually apparently a " broadcast domain " but it's usually the subnet). 您可以为此发送广播数据包,但只能在单个子网(实际上显然是“ 广播域 ”,但通常是子网)中工作。 If you just try every IP you can think of you might trigger firewall pop-ups that suggest that your software is trying to hack the computer.
如果您仅尝试使用每个IP,您可能会想到,您可能会触发防火墙弹出窗口,提示您的软件正在试图入侵计算机。 I think the best way is to use broadcast for the current subnet and offer a user interface for adding other hosts.
我认为最好的方法是对当前子网使用广播,并提供用于添加其他主机的用户界面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.