aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes Bind java socket to a specific device Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Bind java socket to a specific device" Watch "Bind java socket to a specific device" New topic
Author

Bind java socket to a specific device

Itzak Skenstrom
Greenhorn

Joined: Dec 01, 2004
Posts: 1
Does anyone know if it's possible to bind a socket to specific device like "eth0"? If so, how to I do that?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8291

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Bind java socket to a specific device
 
Similar Threads
connection refused
Android Development - examples
UDP connections in Java
does anyone know how to write an NIO provider?
Scrabble... it only takes a minute...