By default, a ServerSocket will listen on all available network interfaces, including each Ethernet card and localhost, as well as all virtual IP addresses mapped to the Ethernet cards. You can restrict this by IP or hostname. This example is taken from Chapter 10, Sockets for Servers:
For example, login.ibiblio.org is a particular Linux box in North Carolina. It�s connected to the Internet with the IP address 188.8.131.52. The same box has a second Ethernet card with the local IP address 192.168.210.122 that is not visible from the public Internet, only from the local network. If for some reason I wanted to run a server on this host that only responded to local connections from within the same network, I could create a server socket that listens on port 5,776 of 192.168.210.122 but not on port 5,776 of 184.108.40.206, like so:
Joined: Jan 29, 2003
Ah, makes sense each card would have its own IP address. Hard to believe I actually passed a network class once I was wondering if we could tie this back to the original request and make a Java software ethernet-to-serial solution, or any kinda input to any kinda output. That is pretty much the whole magic of "inter" in the Internet.