为对等网络应用程序的网络发现 [英] Network Discovery of an application for peer to peer network

查看:205
本文介绍了为对等网络应用程序的网络发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有两个类,服务器类和客户端类。服务器类应收到的IP地址和每个新客户的端口号,并将它们存储在列表中。它应与连接的客户端和它们的IP地址的列表提供每个客户端。然后,客户机可以互相使用TCP连接进行通信。

I wish to have two classes, a server class and a client class. The server class should recieve the IP address and Port number of each new client and store them in a list. It should supply each of the clients with a list of connected clients and their IP addresses. The clients could then communicate with each other using TCP connections.

美中不足的是,该客户端将不知道服务器的IP地址是什么。整个程序将一个局域网上不过运行。我的猜测是,它需要某种UDP广播的,但每一次我尝试impliment这一点,除非该程序的两个实例在同一台计算机上运行它不起作用。

The catch is that the clients won't know what the IP address of the server is. The entire program will however run on a local area network. My guess is that it needs some sort of UDP broadcast, but every time I try to impliment this it doesn't work unless the two instances of the program are running on the same computer.

该应用程序将通过有限的计算知识的客户端进行安装,因此应该只是在所有计算机上安装程序,并在网络堵塞的情况。

The application would be installed by clients with limited computing knowledge so it should just be a case of installing the program on all the computers and plugging in to the network.

如果任何人有这个使用C#.NET 3.5的一个可靠的,明确的执行力度或更早它会非常感激。

If anyone has a reliable, clear implimentation of this using C#.net 3.5 or earlier it would be much appreciated.

推荐答案

您可能会或可能不希望使用 Lidgren网络库 ,但是源代码可用,但确实为服务器发现UDP广播给你看看。

You may or may not want to use the Lidgren network library, but the source code is available and it does udp broadcast for server discovery for you to check out.

这篇关于为对等网络应用程序的网络发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆