开发者

Java socket system address

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 th开发者_JAVA百科ey both appear the same.

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


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜