Getting the unique string(such as an IP address) of a PC unit when connecting to the UDP Server

39 views Asked by At

How to get the unique string(such as an IP address) of a PC unit when connecting to the server.

I can get the IP address of a pc unit if the unit sends a msg to the server.

However, I want to know how to get the unique string such as IP address of a pc unit just by running java UDPClient which connects to the server and not needing to send a msg to get the IP address.

1

There are 1 answers

2
Joni On

You can't. If the client doesn't send a message to the server the server doesn't even know the client exists. UDP doesn't have permanent connections, just individual messages going back and forth.