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).
精彩评论