Bind java socket to a specific device
posted 12 years ago
You need to take a look at Java Tutorial: Custom Networking. We bind sockets to ports, which are abstractions of access points to the network. There are several layers of abstraction between the Java API and the physical device, for example, the protocol layer (tcp, udp), the transport layer (ip), and whatever API's the OS uses for physical access to the hardware, then the physical hardware iteself. The reason for the layered approach is to simplify programming at one particular layer. For example, when we write an application we don't have to worry about moving the data from our computer to the destination because the transport layer does it for us.