Java套接字系统地址

发布于 2024-11-25 13:54:08 字数 192 浏览 2 评论 0原文

如何识别使用同一调制解调器连接或共享同一互联网连接的不同系统?我在Connection上应用了getHostAddress()和'getHostName()'(这是socket.getInetAddress()),但看起来它们看起来是一样的。

我只是想知道连接的不同用户是否来自同一系统共享相同的IP。

How to identify different system connected with same modem or sharing same internet connection? I applied getHostAddress() and 'getHostName()' on Connection(this is socket.getInetAddress()) but it seems like they both appear the same.

I just wanted to know whether different users who are connected are from same system sharing same IP.

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

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

发布评论

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

评论(1

街角迷惘 2024-12-02 13:54:08

您无法使用 IP 提供的功能(可能是 TCP 或 UDP)来做到这一点。这就是为什么您使用 getHostAddress() 获得的 IP 地址是相同的。

您正在实现的协议(如果它是其他人指定的已经存在的协议)必须支持某种客户端识别,或者(如果它是您自己的协议)您必须自己实现它,例如使用一些任意校验和客户端特定数据(硬件 GUID 或类似数据)。

You can't do that with the functionality provided by IP (may it be TCP or UDP). That's why the IP address you get using getHostAddress() is the same.

Either the protocol you're implementing (if it's an already existing protocol specified by someone else) has to support some sort of client identification or (if it's you're own protocol) you have to implement this yourself, e.g. using some arbitrary checksums on client specific data (hardware GUID or similar).

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