Results 1 to 2 of 2
- 07-09-2010, 06:11 PM #1
Member
- Join Date
- May 2010
- Location
- Florida
- Posts
- 68
- Rep Power
- 0
binding a java program to a specific networkcard
Hi
how can I bind a java application to a specific LAN (in case you have more than one network card on your computer), my problem is that I have two LANs on my computer each connected to a different network and I am developing a java application which should communicate with one of the networks, the problem is that when the two LANS are ON the java application gets confused some times and simply donot connect, but when i turn the unwanted LAN (i.e. keeps only one LAN working) every thing works fine so I think if i bind the java application to the desired LAN I can work with both LANs ON, any ideas about binding a java program to use a specific LAN.
(NOTE: one of the LANs is connected to a local network while the other is connected to the Internet).
Regards.
Anderson.
- 08-03-2010, 05:16 AM #2
Member
- Join Date
- Mar 2008
- Posts
- 6
- Rep Power
- 0
Not so much to the card itself as to the IP Address that it's subject to. Using java's socket api you could do something such as...
And this would bind it to whatever card is using "xx.xxx.xxx.xx"Java Code:InetSocketAddress addy = new InetSocketAddress("xx.xxx.xxx.xx", 9000); ServerSocket s = new ServerSocket(); s.bind(addy);
DHCP Reservation is your friend!
Regards,
- Jon
Similar Threads
-
Trouble binding a Java Bean to XML using JAXB
By jazzy_jeff in forum XMLReplies: 0Last Post: 05-04-2010, 10:10 PM -
How to assigne Java thread to a specific cpu core
By perl0101 in forum Advanced JavaReplies: 3Last Post: 02-03-2010, 09:39 AM -
Link to specific part of a Java Servlet
By jwilley44 in forum Java ServletReplies: 2Last Post: 02-03-2009, 01:51 AM -
how do i print a specific txt file on a specific printer
By nikhilbhat in forum New To JavaReplies: 2Last Post: 11-08-2008, 10:40 AM -
Custom XML to Java Type Binding using JAXB
By surajkumar in forum XMLReplies: 0Last Post: 09-02-2008, 12:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks