We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
对于大学项目,请阅读一些有关套接字的教程。我相信这也是你的教授对你的期望。以下面为例: http://www.oracle.com/technetwork/java /socket-140484.html
有两种通用解决方案:全服务器和无服务器。如果是基于服务器的解决方案,您的所有客户端都应预先配置服务器的 IP 地址。服务器打开服务器套接字并开始侦听。因此,每个客户端连接到服务器并注册。注册非常简单:服务器只需要客户端的IP即可。现在服务器保存已连接客户端的列表并将该列表发送给每个客户端。为了使peer2peer应用程序每个客户端也打开服务器套接字。当客户端 A 希望连接到客户端 B 时,它只需连接到其套接字。
您可以实施无服务器解决方案。在这种情况下,您需要一些基于例如广播的发现机制。
我希望这有帮助。祝你好运。
For university project read some tutorial about sockets. I believe that this is what your professor is expecting from you. Take for example the following: http://www.oracle.com/technetwork/java/socket-140484.html
There are 2 general solutions: server-full and server-less. In case of server based solutions all your clients should be pre-configured with the server's IP address. Server opens server socket and starts listening. So, each client connects to server and registers. The registration is very simple: server just needs the client's IP. Now server holds a list of connected clients and sends the list to each client. To make peer2peer app each client opens server socket too. When client A wishes to connect to client B it just connects to its socket.
You can implement server-less solution. In this case you need some discovery mechanism based for example on broadcasting.
I hope this helps. Good luck.
您想要检查 JXTA。该网站已移至 jxse.kenai.com。实用的 JXTA II 书籍已可供在 Scribd 上阅读。
You want to check JXTA. The site has moved to jxse.kenai.com. The practical JXTA II book has been made available for reading on Scribd.