I know that the Socket class can be instantiated in this way (as an example):
new Socket("taranis", 7);
where "taranis" is the name of the server in a local network. In this respect I have two questions:
1. If my computers do not form a local network but are connected to the Internet, can I use the IP addresses of computers to instantiate a socket?
2. How my computers get names in the local network? Do I give names to the computers when I create the network.
P.S. I herd that computers can establish a network by themself (using zeroconf). Who then gives names to the computers and how can I know these names in advance (I need them to write my code).